One user different PHP versions per directories . I have Cloud linux+php selector

Iondr

Registered
Dec 15, 2022
4
0
1
Romania
cPanel Access Level
Website Owner
Hey! I have Cloud linux+php selector and is working for the primary domain(php 5.6) , the other one i tried to set php80 with .htaccess file
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php80___lsphp
</FilesMatch>
Is not working all i get is "Your PHP installation appears to be missing the MySQL extension" . If i run phpinfo.php in that directory i don't see the MySQL extension (i see php80).
 

Iondr

Registered
Dec 15, 2022
4
0
1
Romania
cPanel Access Level
Website Owner
Hey there! Can you try and set the PHP version using the CloudLinux tools or cPanel >> MultiPHP Editor? Manually tweaking the .htaccess will likely not give you the desired results.
I use php selector for that and i have php 5.6(current) and is working but i need php 8.0 for another directory in the same account.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,241
2,217
363
cPanel Access Level
Root Administrator
Could you make that directory a subdomain? If so, that would allow to the MultiPHP tools to see that as a unique area for web content, and that would take care of the issue and let you do that directly through the interface.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,833
422
438
Finland
cPanel Access Level
Root Administrator
When you set PHP version using CloudLinux PHP Selector it will be that account's default PHP version.
After that you can select another PHP version in cPanel MultiPHP Manager. You can't set PHP version for a directory but if you create a subdomain pointing to that directory it will work.

EDIT: seems cPRex has the same idea :-p
 
  • Like
Reactions: cPRex

Iondr

Registered
Dec 15, 2022
4
0
1
Romania
cPanel Access Level
Website Owner
Thx! In that account i have 3 sites, it works with MultiPHP Manager, now i have 2 sites with php 5.6 by php selector and 1 with php81 by MultiPHP Manager. I found something strange, if i set php80 (MultiPHP Manager) is not working, only php74&php81.
 

Iondr

Registered
Dec 15, 2022
4
0
1
Romania
cPanel Access Level
Website Owner
My bad, is working (wordpress) but on php 5.6 when i select ea-php80 in multi php manager. If i select 8.1 and do refresh on /phpinfo.php i see 8.1 with 80 selected phpinfo.php is showing 5.6. Is ok 81 or 74, thx for help!