• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Question Different PHP version for folders

Thomas Oryon

Regular Pleskian
Hello Support,

We have plesk in both Linux & Windows server. We can able to change the PHP version for each website. Whether is it possible to have different PHP version for each folders?

Awaiting your reply.
 
Hi, @Thomas Oryon . No, it's not possible to configure a different PHP version on a per directory-basis. However, if you provide more details on the context of your question and an example of your end goal, we can try to suggest an alternative.
 
Hi, @Thomas Oryon ,
If this can help I do exactly this with some .htaccess magic.
Context:
1. create a subdomain for the domain, just to select the php handler your want to use in your folder.
2. reroute the handler from that subdomain in a .htaccess in the folder.

Here under an example of a folder where I wanted another php handler (handler has to exist in your Plesk/System) than the one that is defined for the website.

#This WORKS! I replace the SetHandler with a line from another hosting with php I want
#Add this at the beginning of your .htaccess
RemoveHandler .php
<Files ~ (\.php)>
SetHandler None
SetHandler proxy:unix:///var/www/vhosts/system/<existing subdomain.yourdomain.tld with handler you want>/php-fpm.sock|fcgi://127.0.0.1:9000
Options +ExecCGI
allow from all
</Files>
 
Back
Top