tags:

views:

79

answers:

3

I am looking to see what it takes to have multiple installs of php in osx 10.5. I found this page that goes on to explain it for windows.

I was looking for confirmation from someone that knows better than me, if the steps are very similar for 10.5.

I am a novice user. Having only scripted with php, not actually building or installing it. My web host runs a php older than I have installed. And I'd like to at least test locally on a version the same as my remote option.

Any help is appreciated. Thanks.

A: 

You should find a tutorial for Linux or BSD, which would be a lot more helpful then a Windows-based one.

MiffTheFox
A: 

Some time ago I managed to do it on WIndows and wrote a quick how-to. While I don't believe it could be much relevant to OS X (except maybe for the part showing how to switch engine in .htaccess) I can give you some hint about the basic points:

  1. Install as CGI, not as an Apache module;
  2. ignore any instruction to put your php.ini in a common location or set up environment variables pointing to a single php.ini: what you definitely need is a separate php.ini for each PHP version, so you have to put them in the respective PHP folder to be found;
  3. when testing check with phpinfo() which php.ini is actually being loaded.

Just for sake of completeness I'd add that at the time of writing (2007) both PHP4 and PHP5 were happy to run with each other's php.ini - until I started loading extensions: those are compiled for their PHP version only and go into a spin if used with the wrong PHP.

Hope I've been helpful.

djn
A: 

Is one of the servers running PHP 5 and the other PHP 4?

If so you can run PHP 5 in PHP 4 mode by enabling the following in your php.ini file:

zend.ze1_compatibility_mode = 1

If you can't edit the php.ini file then you can't change the local version for the script running by adding the following to your PHP script:

@ini_set('zend.ze1_compatibility_mode', 1);

Jacob Wyke
I'd upvote this, but can't, not enough points or something. This is the simplest solution to what I need 2 installs for. Thanks.
ghidra