0

I have a setup where I've unfortunately hit a version limit between a library package required for an application, and my version of PHP.

I'm now running PHP 5.4, but the module is only compatible with 5.3, leaving me in a bind.

I'm aware that I can run multiple versions of PHP using fcgi, but is it possible to run them separately with different modules, and if so how would I implement the module (the module is packaged as a .deb file with dependencies defined)?

Clorith
  • 181
  • 1
  • 8

2 Answers2

0

Yes, it possible. All you need is to use some of php as module for apache and other one as cgi. Each of php could have own php.ini with uniq list of modules to download.

For example I'm using php-5.3.27 as apache module and php-5.2.17 as cgi as one of our application required 5.2.x and doesn't work on 5.3.x

for php-5.2

Loaded Configuration File   /usr/local/php-5.2.17/lib/php.ini 

for php-5.3

Loaded Configuration File   /etc/php.ini

You could set the path in which to look for php.ini in configure option with

--with-config-file-path
ALex_hha
  • 7,193
  • 1
  • 25
  • 40
0

In order to accommodate multiple versions of PHP on a single platform, you'll need to make changes to your config file, make file (or spec file for rpm) so that the binaries and support files have names like php53(.ini) and php54(.ini), /usr/lib64/php54/modules, yada, yada, yada. Changing the config options is important so it knows where to look for it's own modules, ini's, etc... Installing one version and changing names on the files will not change the compiled in internal settings. (You can compile modules into the binary but I don't recommend this.)

You can set the default version by creating a link from php to the version of your choice.

As far as Apache is concerned, you can try the following:

FcgidWrapper "/usr/bin/php-cgi53 -c /etc/httpd/conf/php53.ini" .php

or

FcgidWrapper "/usr/bin/php-cgi54 -c /etc/httpd/conf/php54.ini" .php5

Hope this helps you.

Borgboy
  • 131
  • 3