3.99 Pro :: Multiple PHP5 Versions

I have Virtualmin Pro 3.99 installed on CentOS 5.2 (32 bit). I am keen to use the new multiple PHP versions feature. I've installed PHP 5.4 from the collections repository as per your documentation on the feature:

http://www.virtualmin.com/documentation/web/multiplephp

I can see the PHP5.4 install in the /opt directory, but Virtualmin is failing to detect it. What am I missing? I have rebooted but still it isn't detected.

Many thanks GREG

Status: 
Active

Comments

Howdy -- what output do you receive when you go into System Settings -> Re-Check Config?

Also, what output do you receive if you run this command:

ls -l /opt/rh/php54/root/usr/bin/php-cgi

Hi andreychek

ls -l /opt/rh/php54/root/usr/bin/php-cgi:

...produced:

ls: /opt/rh/php54/root/usr/bin/php-cgi: No such file or directory

...which shows why Virtualmin isn't finding it! I therefore did:

yum install php54-php

This installed both 'php54-php' & 'php54-php-cli', a Re-Check Config then showed:

The following PHP versions are available : 5.2.6 (/usr/bin/php-cgi), 5.4.13 (/opt/rh/php54/root/usr/bin/php-cgi) - yay!

I could now see the version options under a domain's 'Server Configuration->PHP Versions'.

However restarting apache showed this:

Stopping httpd:                                            [  OK  ]
Starting httpd: [Thu Mar 21 09:41:31 2013] [warn] module php5_module is already loaded, skipping
                                                           [  OK  ]

...at which point I realised the PHP on my server was then failing to pass and was treated as plain text (all websites down, yikes!). A quick YUM remove of 'php54-php' and 'php54-php-cli' and restart of apache brought everything back online again, so no harm done.

So why did PHP end up hosed on the server after the 'php54-php' install? Any thoughts would be appreciated. If I can get this running it will be a really excellent feature of Virtualmin which I desperately need.

Many thanks GREG

It looks like the documentation may be missing one of the PHP packages you need.

Try installing just the php54-php-cli package:

yum install php54-php-cli

And see if that works. Doing that should enable you to use both FCGID and CGI.

Installing the 'php54-php-cli' package on it's own seems to have things running almost as expected, although I have now encountered a couple of anomalies when switching back and forth between PHP versions for a domain.

Firstly I see that the symbolically linked php.ini file in the domains 'etc' folder is broken, it points to 'php54/php.ini', the 'php54' folder doesn't exist.

Secondly please see the attached screen grab of a domains 'PHP Versions' page 'System Configuration -> PHP Versions'. The multiple instances of 'Default HTML directory' don't seem to break anything, but is presumably not the intended behaviour?

That screen shot looks like the sign of a bug in Virtualmin.

Would it be possible for you to post the Apache configuration for this domain? It will be in the file /etc/httpd/conf/httpd.conf, in the <virtualhost> block that contains the domain name.