How to change PHP version only for subdomain?

Magician

Verified User
Joined
Jan 31, 2010
Messages
124
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
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
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:

adam.langowski

New member
Joined
Apr 29, 2016
Messages
2
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|
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,255
Location
GMT +7.00
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.
 

iCafe

Verified User
Joined
Apr 9, 2007
Messages
26
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.
 
Top