How to switch to a different PHP version?

AVHoster has implemented a server setup that allows each customer to choose which version of PHP to use for their account. Our customers can also use different PHP versions for different directories in the same hosting account.

The PHP versions currently supported for Wordpress Hosting are PHP 7.0, PHP 7.1 and PHP 7.2.

To change the PHP version in your AVHhosting account simply follow the steps below:

  • Log in to your DirectAdmin Control Panel account
  • Go to Advanced Features section > Select PHP version
  • At the top you will see the current PHP version, next to the PHP version choose your version from the drop-down and click "Set as current"  and you're done!

To roll a different PHP version in a subdirectory or sub-domain:
Create a .htaccess file in the desired directory where you want to have a different from default PHP version with right handler:
To switch to PHP 7.2

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

As a result, subdirectories will use the same PHP version as a parent unless you overwrite it with another .htaccess entry in that subdirectory.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Use PHP and MySQL

PHP is the most popular scripting language for web development. It is free, open-source and...

How to Select Individual Records

As well as showing the whole Database, PHP can be used to select individual records or records...

How to Connect to Your Database

You should establish a connection to the MySQL database. This is an extremely important step...

Creating a database table

Before you can do anything with your Database, you should create a table and set the...

Pear Modules

By default all AVHoster servers have the following Pear packages installed: Archive_Tar...

Powered by WHMCompleteSolution