Changing php version

Modified on Sat, 11 May 2024 at 07:09 PM

LIST OF AVAILABLE VERSIONS


By default, all servers use PHP 7.4 for new sites. To change the version you need to make some changes.

To change the PHP version for an individual site, you need to make changes to the .htaccess file, which is located in the root directory. If you change the version for all sites, you can create a .htaccess file in the root of your account and add a line to it.

If there is no .htaccess file, you need to create it and fill it with the necessary lines.


HOW TO UPDATE PHP VERSION


Version 5.2
Add to the .htaccess file: AddHandler application/x-httpd-php-5.2 .php


Version 5.3
Add to the .htaccess file: AddHandler application/x-httpd-php-5.3 .php


Version 5.4
Add to the .htaccess file: AddHandler application/x-httpd-php-5.4 .php


Version 5.5
Add to the .htaccess file: AddHandler application/x-httpd-php-5.5 .php


Version 5.6
Add to the .htaccess file: AddHandler application/x-httpd-php-5.6 .php


Version 7.0
Add to the .htaccess file: AddHandler application/x-httpd-php-7.0 .php


Version 7.1
Add to the .htaccess file: AddHandler application/x-httpd-php-7.1 .php


Version 7.2
Add to the .htaccess file: AddHandler application/x-httpd-php-7.2 .php


Version 7.3
Add to the .htaccess file: AddHandler application/x-httpd-php-7.3 .php


Version 7.4
Add to the .htaccess file: AddHandler application/x-httpd-php-7.4 .php


Version 8.0
Add to the .htaccess file: AddHandler application/x-httpd-php-8.0 .php


Version 8.1
Add to the .htaccess file: AddHandler application/x-httpd-php-8.1 .php


Version 8.2
Add to the .htaccess file: AddHandler application/x-httpd-php-8.2 .php


Version 8.3
Add to the .htaccess file: AddHandler application/x-httpd-php-8.3 .php


CHANGING THE .HTACCESS FILE

Where can I find the .htaccess file?

The .htaccess file is located in the root directory of the site. You can find it out using our service. If there is no .htaccess file in this directory, create one.


How to edit the .htaccess file?

Let's take the .htaccess file of a website running on WordPress as an example. Since this is a text file, we edit it in a text editor.


To change the PHP version to 7.4, add AddHandler application/x-httpd-php-7.4 .php as the first or last separate line in the .htaccess file. 


Please note that the hosting control panels display the system version of the PHP server. You need to check the PHP version on the site using the phpinfo() function.

To find out the PHP version, create a file phpinfo.php in the root directory of the site with the content <?php phpinfo();. Type “domain.ru/phpinfo.php” in the address bar of your browser, where domain.com is the address of your website. A file will open in which you can see what version of PHP is installed for the site.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article