How to use a different PHP version on a subdomain with custombuild 2?

pinooo

Verified User
Joined
Dec 1, 2004
Messages
15
Hi all,

I am trying to get PHP7.1 working on a subdomain. Default is PHP5.5 for that domain.
I use custombuild 2 and when I use the PHP selector to change the PHP version for the domain it works as expected. But I need PHP 7.1 for the subdomain new.domain.com and not the default PHP 5.5 for testing.

I have this in de options.conf

#PHP Settings
php1_release=5.5
php1_mode=mod_php
php2_release=7.1
php2_mode=php-fpm


I have tried adding this to the custom hhtpd.conf of that domain.

Code:
<Directory |DOCROOT|/new/>
   <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>

According to a forum post here, but is does not work, running phpinfo on the new subdomain it gives me still PHP 5.5

I think I am doing something wrong... But what?

Who can point me in the right direction.
 
Last edited:
Hello,

Try

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

Try

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

Hi zEitEr
I try to add this on httpd.conf customisation for my domain, but without effect.

I have PHP 7.1 on the domain.
I need PHP 7.2+ on a subdomain

So, I replace /new/ by my folder.
I try with PHP2_RELEASE or PHP1_RELEASE

I've 4 PHP versions (7.1 to 7.4 installed)

Do you have an idea ?
Maybe I forgot to reload something, so it's not active ?

Thanks for your help.

 
Best result and quick way is: make an subdomain in your domain configuration, simply add the subdomain like subdomain.domain.com

Subdomain has then his own docroot and you can give it any php version you want, beware that the folder name don't exists before adding or just simply rename it
 
Yes I know, but I have all link to change, if I do that.
And, it was a real choice to put in a folder, and not in a subdomain (SEO strategy choice).

So, I see it's possible, and I want to use it if possible, before to migrate, the oldest part, to a new one in some months
 
Back
Top