Changing PHP Versions

Support Category(s): Cpanel, Helpful Information
Last Updated: May 14, 2020

You change PHP versions by using your CPANEL or Control Panel

Accessing CPANEL
You can use https://sv5.nzhost.net.nz:2083/ or http://yourdomain.xxx/cpanel

Under the software section find this icon called Select PHP version

You can set the PHP version only for the entire domain

The default version of PHP selected will show at the top – currently set at PHP 5.5

Suggest that use the Tab Use Defaults – then you can customise the settings if you want.
(Note if nothing is loaded for the PHP version you want to use please click on the ‘Reset to Default button’ or ‘Use Defaults’ then check the values and save or set)
(The CPANEL screen you see display depends on the theme you are using)

PHP 5.3
PHP 5.4
PHP 5.5
PHP 5.6
PHP 7.0
PHP 7.1
PHP 7.2
PHP 7.3
PHP 7.4

When you have selected your PHP version then click save.
If you encounter errors on the new PHP version you can either resolve the issue or switch back to the previous version.

Note:-
Make sure that any PHP directives such as php_flag or php_value in the .htaccess file are valid for the PHP version you are using otherwise you may encounter an internal server error.

Example php_flag register_globals Off will not work on PHP versions higher than PHP 5.3

Changing PHP on a Subfolder or Addon Domain

The first step is to use the PHP selector within your CPANEL and select the version of PHP you want in the subfolder.

If you see nothing in the modules selected click on reset to default button and then check what modules are loaded.
DO NOT CLICK ON SET AS CURRENT.
All this does is load the correct values for the modules.

In the main .htaccess file of the folder add this code to the top of the .htaccess file in the subfolder you want a different PHP version.

<FilesMatch “\.php$”>
SetHandler application/x-lsphpxx

Most PHP file will have the extension php if not you could use this command

<FilesMatch “\.(php4|php5|php3|php2|php|phtml)$”>
SetHandler application/x-lsphp71

Replace xx with the version of PHP

lsphp53
lsphp54
lsphp55
lsphp56
lsphp70
lsphp71
lsphp72
lsphp73
lsphp74

All too hard?

Get NZServers to do this

Note there is a charge for doing this of $55.00 excl of GST as you can do this yourself.


    [radio php-value “PHP 5.3” “PHP 5.4” “PHP 5.5” “PHP 5.6” “PHP 7.0” “PHP 7.1” “PHP 7.2” “PHP 7.3″ PHP 7.4”]


    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.