How to change PHP version only for subdomain?

Magician

Verified User
Joined
Jan 31, 2010
Messages
135
Location
EU / PL
Hi,

I use CB 2.0, two version PHP as php-fpm and I want to change php version only for subdomain. How to do it?

Best regards
 
try and add as CUSTOM into Directadmin for the domain:

Code:
 <Directory |DOCROOT|/subomain/>
   <FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
      AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
   </FilesMatch>
 </Directory>

if you need PHP1 for the subdomain.

Code:
 <Directory |DOCROOT|/subomain/>
   <FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
      AddHandler "proxy:unix:/usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .php|PHP2_RELEASE|
   </FilesMatch>
 </Directory>

if you need PHP2 for the subdomain.

Replace the subdomain with an actual subdomain name.

I did not test it myself.
 
Last edited:
Good morning,

how can I set that in Litespeed direct admin custom httpd setting?

For example I have such setting there:

|*if SUB="base.beta"|
|?DOCROOT=`HOME`/domains/domain.pl/subdomains/beta/base|
|*endif|
 
And what is wrong with NGINX+Apache? It's still Apache which rules PHP version for a domain, and NGINX is only a reverse proxy here.
 
try and add as CUSTOM into Directadmin for the domain:

Code:
 <Directory |DOCROOT|/subomain/>
   <FilesMatch "\.(inc|php|phtml|phps|php|PHP1_RELEASE|)$">
      AddHandler "proxy:unix:/usr/local/php|PHP1_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .inc .php .phtml .php|PHP1_RELEASE|
   </FilesMatch>
 </Directory>

if you need PHP1 for the subdomain.

Code:
 <Directory |DOCROOT|/subomain/>
   <FilesMatch "\.(inc|php|phtml|phps|php|PHP2_RELEASE|)$">
      AddHandler "proxy:unix:/usr/local/php|PHP2_RELEASE|/sockets/|USER|.sock|fcgi://localhost" .php|PHP2_RELEASE|
   </FilesMatch>
 </Directory>

if you need PHP2 for the subdomain.

Replace the subdomain with an actual subdomain name.

I did not test it myself.

it not work.
 
Back
Top