Cara Merubah versi php di Cpanel
- Log in to cPanel for your account.
- Go to 1H Software section -> PHP Version Manager
- Navigate to the directory you would like to change the PHP version for (note that the change will apply to sub-directories for it as well)
- Click on the directory name.
- Select the desired PHP version and click Save.
That is all.
You can find detailed instructions how to manually change the PHP version for your account below:
Go to cPanel, File Manager and choose “Web Root (public_html/www)”. There create a new file (or edit the existing one) called .htaccess and add the following line:
To switch to PHP 4.4:
AddHandler application/x-httpd-php4 .php .php4 .php3
To switch to PHP 5.0:
AddHandler application/x-httpd-php5 .php .php5 .php4 .php3
To switch to PHP 5.1:
AddHandler application/x-httpd-php51 .php .php5 .php4 .php3
To switch to PHP 5.2:
AddHandler application/x-httpd-php52 .php .php5 .php4 .php3
To switch to PHP 5.3:
AddHandler application/x-httpd-php53 .php .php5 .php4 .php3
To switch to PHP 5.4:
AddHandler application/x-httpd-php54 .php .php5 .php4 .php3
To switch to PHP 5.5:
AddHandler application/x-httpd-php55 .php .php5 .php4 .php3
To switch to PHP 5.6:
AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
To switch to the secure PHP 5.2 with Suhosin patch:
AddHandler application/x-httpd-php52s .php .php5 .php4 .php3
This setting will apply recursively to all of the subdirectories. In case you’d like to have a different version of PHP in a subdirectory, create a new .htaccess file in it with the directive for the desired PHP version in it.
Leave a Reply
Want to join the discussion?Feel free to contribute!