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
</FilesMatch>
As a result, subdirectories will use the same PHP version as a parent unless you overwrite it with another .htaccess entry in that subdirectory.