Multi PHP version with phpbrew on Ubuntu 14

3 posts / 0 new
Last post
#1 Wed, 04/01/2015 - 10:24
te-deum

Multi PHP version with phpbrew on Ubuntu 14

Hello,

I use Virtualmin server on Ubuntu 14. I have some scripts who need to run with PHP 5.3. In order to have PHP 5.3, I compile PHP 5.3.29 with pbpbrew. Then I create a symlinks to the build folder and I copy the build folder but Virtualmin dont find the new PHP version in /opt/rh/php53. Message from Virtualmin refresh information : The following PHP versions are available : 5.5.12 (/usr/bin/php5-cgi)

More information : - phpbrew (latest version) - php v5.3.29 - build folder : /root/.phpbrew/build/php-5.3.29 - Folder group/owner : syslog uuidd - Symlink : /opt/rh/php53

What could I do to have PHP 5.3 working in Virtualmin ??

Thank you.

Wed, 04/01/2015 - 13:41
andreychek

Howdy,

This is the section of code that looks for PHP versions:

                # For a version like 5.4, check for binaries like php54 and
                # /opt/rh/php54/root/usr/bin/php
                $phpn ||= &has_command("php$VERSION-cgi") ||
                          &has_command("php-cgiVERSION") ||
                          &has_command("/opt/rh/php$VERSION/root/usr/bin/php-cgi") ||
                          &has_command("/opt/atomic/php$VERSION/root/usr/bin/php") ||
                          &has_command("/opt/rh/php$VERSION/bin/php-cgi") ||
                          &has_command("php$VERSION") ||
                          &has_command("/opt/rh/php$VERSION/root/usr/bin/php");
                          &has_command("/opt/rh/php$VERSION/bin/php") ||
                          &has_command(glob("/opt/phpfarm/inst/bin/php-cgi-$VERSION.*"));

You'd want to make sure that your PHP path matches one of the above.

For example, putting it in /opt/rh/php53/bin/php or /opt/rh/php53/bin/php-cgi is a common way of doing that.

-Eric

Thu, 04/02/2015 - 08:22
te-deum

Hello,

I have my php into the /opt/rh/php53/bin folder :

root@serveur:/opt/rh/php53/bin# ls -l
total 29152
-rwxr-xr-x 1 root root      912 avril  1 17:52 pear
-rwxr-xr-x 1 root root      933 avril  1 17:52 peardev
-rwxr-xr-x 1 root root      849 avril  1 17:52 pecl
lrwxrwxrwx 1 root root       43 avril  1 17:52 phar -> /root/.phpbrew/php/php-5.3.29/bin/phar.phar
-rwxr-xr-x 1 root root    14847 avril  1 17:52 phar.phar
-rwxr-xr-x 1 root root 29807880 avril  1 17:52 php
-rwxr-xr-x 1 root root     4031 avril  1 17:52 php-config
-rwxr-xr-x 1 root root     4540 avril  1 17:52 phpize

I don't understand why my PHP is not recognized :-( Any other idea ?