This article explains how to force PHP to load a file that does not end with the extension .php.
Using an .htaccess file
To process files with PHP whose names don't end with ".php", you can use a directive in .htaccess.
For example, create a file named myfile.test with the following code:
<?php echo ‘testing an extension using PHP’; ?>
The extension .test doesn’t exist. But, you can force it to run as PHP by adding this code to your .htaccess file:
AddHandler fcgid-script .test FcgidWrapper "/dh/cgi-system/php72.cgi" .test
If you load the file in a browser, it will now load as a normal PHP file.
CGI and FCGI
In the above example, files with the extension .test are using PHP 7.2 with FastCGI.
If you do not want to change the version of PHP but want PHP to use CGI (instead of FastCGI), use this line in your .htaccess file:
AddHandler php-cgi .test
If you use the php5-cgi directive in a FastCGI environment you'll force all PHP code in the specified extensions to be run using CGI regardless of what option you choose in the panel.