Restore DirectAdmin .php file extension in /var/www/html

By | September 28, 2019

In earlier versions of DirectAdmin it was possible to use .php<php version> files in the /var/www/html directory, running under the webapps user. For example .php56 files are executed with PHP 5.6 and .php73 files are executed with PHP 7.3. We use this to monitor the PHP-FPM daemon. In one of the DirectAdmin updates this function was removed from the Apache config and only the first PHP version in Custombuild is available to the webapps user.

To restore this PHP functionality create the following file:

/etc/httpd/conf/extra/apache_test_php.conf:

and add the following line to file /etc/httpd/conf/extra/httpd-includes.conf:

Now restart Apache and .php56/.php71/.php72/.php73 files will be executed with the correct PHP version (depending on the PHP versions you have installed with Custombuild)

Leave a Reply

Your email address will not be published. Required fields are marked *