The customer portal my.neoserv.com has been redesigned. If you notice any issues, please let us know.

Cart (0)
  • Your cart is currently empty.

USER INSTRUCTIONS

Search instructions

As the PHP programming language is still evolving, new PHP versions are always available. The advantage of the newer versions is mainly speed, as the optimisation of the code results in faster execution of commands, which in turn results in faster web pages. One of the simplest measures to speed up the performance of a website is therefore to configure the latest PHP version.

This can be done very easily in the cPanel control panel. You can read more about this in the article “How do I activate the PHP version I want?“. If you follow the procedure described above, you will set the PHP version you have chosen to your entire hosting package.

What if you want to use a newer PHP version for one website and a slightly older version for another? This is also possible. In fact, you can set any PHP version you want for each directory.

Why use different PHP versions?

It may happen that a particular script is not compatible with a particular PHP version. For example, an outdated WordPress graphical template that does not work on PHP 8.3, but works on PHP 7.2 or earlier. Similar inconveniences can occur with outdated versions of online stores (e.g. Magento 1.6).

If you find yourself in the situation described above and you host several websites with us, you can solve the problem by assigning each website its own PHP version. For sites that support the latest PHP version, set this one, and for “problematic” sites, set the one where the script will run without errors.

How do I set the desired PHP version for the selected directory?

1. Log in to the cPanel control panel of your hosting package.

2. In the FILES section, click on File Manager.

3. Make sure that you have enabled the display of hidden files in the File Manager. To do this, click on the Settings button in the top right corner and tick the box next to “Show Hidden Files (dotfiles)“. Click the Save button to save your changes.

Show hidden files

4. Open the directory to which you want to assign the desired PHP version.

5. Check if there is a hidden .htaccess file in the selected directory. If not, create one. To do this, click on the “+ File” button in the top left corner, name the file .htaccess and click on the “Create New File” button. Make sure you include the leading period in the file name!

6. Right-click on the .htaccess file and select “Edit“.

7. Add the following code to the beginning of the file content:

<FilesMatch "\.(php|phtml)$">
SetHandler application/x-httpd-alt-php70___lsphp
</FilesMatch>

The second line of code contains the PHP version you want to set for the directory. In the example shown, we have chosen version 7.0, but if you wanted to use version 8.1, for example, you would need to add the following command to .htaccess:

<FilesMatch "\.(php|phtml)$">
SetHandler application/x-httpd-alt-php81___lsphp
</FilesMatch>

8. Click on the “Save Changes” button in the top right corner to save your changes.

How to check if the PHP version has really been changed?

1. Create a new file in the directory whose PHP version you have changed using the above procedure (click on “+ File” on the top left). Name the file phpinfo.php.

Edit the new file (right click on it and “Edit“), add the command below and save the change.

<?php phpinfo(); ?>

3. Open the file you have just created in your browser. For example, if you created it in the umbrella folder of the domain “my-domain.com”, open the following page in your browser: www.moja-domena.com/phpinfo.php

PHP version

4. As shown in the image above, you will see details of the PHP version you are using for this directory or for this website.

If you need additional PHP extensions (Extensions) or want to change the settings (Options) for the website for which you have changed the PHP version, please do the following:

1. In the cPanel control panel, locate the Software section and click on Select PHP Version.

2. In the list of PHP versions (Current PHP version) , select the PHP version you want to change the extensions or settings for.

3. Once the PHP version is selected, tick the desired extensions or set any settings you want (any changes will be saved automatically immediately).

Important: After selecting the desired extensions or changing the settings , do not click the Apply button, as this would change the PHP version of the entire hosting package.

We are always available for any further questions via phone or email.

COMMENTS

COMMENT THE POST

(mandatory)
(mandatory, email address will be hidden)
(optional)
Security question that confirms you are a real person.