Author Topic: Selecting different PHP version for subdirectory with PHP-FPM  (Read 6818 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Selecting different PHP version for subdirectory with PHP-FPM
« on: December 18, 2018, 06:57:35 AM »
Hello

In the past I've used the PHP Selector to run a different version of PHP in a subdirectory of my main domain by adding
Code: [Select]
AddHandler application/x-httpd-php56 .php to the .htaccess file
I'm having a hard time replicating this behaviour if I switch to use PHP-FPM on my main domain.

The domain in question:
https://uber1337.dk/
The subdirectory:
https://uber1337.dk/hlstatx/

I've added the PHP 5.6 version to my PHP-FPM Selector
If I create a subdomain and specify the PHP-FPM version to be PHP 5.6 this works for the subdomain
for example
https://stats.uber1337.dk/
But it still won't fork for
https://uber1337.dk/hlstatx/ as the configuration is part of the main domain.

Are there any way to duplicate the behaviour of the original PHP Selector?

Offline
*
Re: Selecting different PHP version for subdirectory with PHP-FPM
« Reply #1 on: December 18, 2018, 08:28:56 AM »
for php-fpm you can select php version only per domain/subdomain from "webservers domain conf"
there is no option like with php-cgi/suphp that you can run it per folder.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: Selecting different PHP version for subdirectory with PHP-FPM
« Reply #2 on: December 18, 2018, 11:28:53 AM »
Thanks

I fixed it by making a redirect to a subdomain, this seems to work rather well
(Webserver settings > Apache Redirects)