Question
How can you configure a different version of PHP for a specific subfolder of a domain?
CPANEL_WARN: This only applies if you are using the suPHP handler. This will not work if using PHP-FPM.
CPANEL_WARN: Sites using PHP Selector should not use the following procedure.
Answer
- Access the server's command line as the cPanel user via SSH or "Terminal" in cPanel.
-
Create an
.htaccessfile in the desired folder.# touch /path/to/folder/.htaccess
- Open the
.htaccessfile in your preferred text editor. -
Add the following lines to the file.
CONFIG_TEXT: <IfModule mime_module>
AddHandler application/x-httpd-ea-php8# .php .php8 .phtml
</IfModule>CPANEL_INFO: Please note that "#" must be replaced with the PHP minor version.
- Save the changes and exit the text editor.
Comments
0 comments
Article is closed for comments.