Control Web Panel

WebPanel => PHP => Topic started by: LeetDonkey on December 18, 2018, 06:57:35 AM

Title: Selecting different PHP version for subdirectory with PHP-FPM
Post by: LeetDonkey 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?
Title: Re: Selecting different PHP version for subdirectory with PHP-FPM
Post by: studio4host 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.
Title: Re: Selecting different PHP version for subdirectory with PHP-FPM
Post by: LeetDonkey 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)