0

I want to have two versions of PHP on one server and switch between them using a symlink.

I have PHP 5.3.2 installed. I want to install PHP 1.4.6 along side it and be able to switch back and forth between them eg;

/opt/php/5.3.2 /opt/php/5.4.21 /opt/php/live -> /opt/php/5.4.21 

as suggested here. However I'm struggling to find out how to do this.

I'm using an Ubuntu 10.04 server running Nginx and PHP-FPM/FastCGI.

To my mind apt-get seems to want to only have one version of each program so I guess having two versions side-by-side must avoid using apt-get or similar utils.

3
  • Not tested yet, but you should be able to specify the php.ini file in nginx.conf. Commented Mar 18, 2014 at 2:04
  • I don't think you can specify the php.ini file in nginx.conf. Nginx passes the HTTP request to PHP using FastCGI ie. ip/port eg. fastcgi_pass 127.0.0.1:9000. To Nginx, PHP is just another server. Commented Mar 18, 2014 at 2:20
  • Then setup a few of those, and pass them over. :) Commented Mar 18, 2014 at 2:29

2 Answers 2

0

You'll have to compile it yourself. To get a compilation that is very close to the precompiled Ubuntu you can use the same config flags as in the Ubuntu source package but with a different --prefix:

 ./configure \ --prefix=/opt/php/5.3.2 \ --enable-force-cgi-redirect \ --enable-fastcgi \ --disable-debug \ --with-regex=php \ --disable-rpath \ --disable-static \ --with-pic \ --with-layout=GNU \ --with-pear=/usr/share/php \ --enable-calendar \ --enable-sysvsem \ --enable-sysvshm \ --enable-sysvmsg \ --enable-bcmath \ --with-bz2 \ --enable-ctype \ --with-db4 \ --without-gdbm \ --with-iconv \ --enable-exif \ --enable-ftp \ --with-gettext \ --enable-mbstring \ --with-pcre-regex=/usr \ --enable-shmop \ --enable-sockets \ --enable-wddx \ --with-libxml-dir=/usr \ --with-zlib \ --with-kerberos=/usr \ --with-openssl=/usr \ --enable-soap \ --enable-zip \ --with-mhash=yes \ --with-system-tzdata \ --without-mm \ --with-curl=/usr \ --with-enchant=/usr \ --with-zlib-dir=/usr \ --with-gd=/usr --enable-gd-native-ttf \ --with-gmp=/usr \ --with-jpeg-dir=/usr \ --with-xpm-dir=/usr/X11R6 \ --with-png-dir=/usr \ --with-freetype-dir=/usr \ --enable-intl \ --with-ttf=/usr \ --with-t1lib=/usr \ --with-ldap=/usr \ --with-ldap-sasl=/usr \ --with-mysql=/usr \ --with-mysqli=/usr/bin/mysql_config \ --with-pspell=/usr \ --with-unixODBC=/usr \ --with-recode=/usr \ --with-xsl=/usr \ --with-snmp=/usr \ --with-sqlite=/usr \ --with-sqlite3=/usr \ --with-mssql=/usr \ --with-tidy=/usr \ --with-xmlrpc \ --with-pgsql=/usr PGSQL_INCLUDE=`pg_config --includedir` \ --enable-pdo \ --without-pdo-dblib \ --with-pdo-mysql=/usr \ --with-pdo-odbc=unixODBC,/usr \ --with-pdo-pgsql=/usr/bin/pg_config \ --with-pdo-sqlite=/usr \ --with-pdo-dblib=/usr 

Of course, any of those modules you don't need can be removed from the configure (e.g. if you are never going to use snmp then change --with-snmp=/usr to --without-snmp or just leave it out altogether)

0

Maybe this helps you out and you can try this without IPSConfig.

http://www.howtoforge.com/how-to-use-multiple-php-versions-php-fpm-and-fastcgi-with-ispconfig-3-centos-6.3

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.