php version via .htaccess

Denzla

New Member
Hello,
I would like to know the correct way to add handler in .htaccess to switch php version.
Thank you
 
If you have EasyApache 4 active you should have a MultiPHP manager available in WHM which allows you to change PHP versions per account. No htaccess configuration needed. However, EasyApache 4 only supports 5.5, 5.6 and 7.0 (some others too depending on your configuration), if you need a different version you'd have to upgrade to CloudLinux or do some unsupported customizing outside of cpanel.

Why is it you need a different version?
 
My server is 5.3 and i need higher version for my Laravel app, however i do not have admin access to the server. Tried to add handlers via .htaccess files and they got recognized in cpanel but php scripts are downloaded not executed. I guess higher versions are not installed on the server but i thought to ask just in case.
Thank you for answering
 
Unless it's configured on the server, you won't be able to change the PHP version from within just a cPanel account, you'll need root access. If you're not the administrator of the server, just ask whoever is, they should be able to help you. There's no reason you should be stuck back on version 5.3. If you're on 5.3 the server is likely using EasyApache 3 which easily allows upgrading to as high as 5.6 without heavily affecting most applications. Your administrator should be able to easily upgrade the server to 5.6 which is what Larvel requires. Your administrator will need to upgrade to EasyApache 4 by January 2018 anyway so they may as well get started now.
 
Hello,

If WHM panel configure with multilevel PHP version then you can change the php version via cpanel (end-user).
If it is configure with single any slevel like (5, 6, 7), then it is not possible via cpanel,
If you have change the php version then the .htaccess file doesn't play any activites.
 
Top