I need to get php 5.3 working on my os server (snow leopard) machine. When I goto a php webpage on the server that is running phpinfo() it tells me that I am running php version 5.2.14, also it informs that php is installed at /private/etc/php.ini. Strangely, when I log onto the server and execute php -v from the terminal it tells me I am running version 5.3.0 and which php tells me that is installed at /opt/local/bin/php. I am confused that I am getting conflicting data from these two sources. How do I make it so that the php version being used on the server is the 5.3.0 version?


You need to edit the Apache config to make it load the new php module, rather than the one that came with the OS. First, find the module you built (not the php program, the loadable module that runs inside Apache); it's probably named something like /opt/local/apache2/modules/libphp5.so. Then, edit /etc/apache2/httpd.conf to load it instead of the builtin one. Find the "LoadModule php5_module" line, and replace "libexec/apache2/libphp5.so" with the path to your updated module.

  • Thanks for your help, I changed LoadModule php5_module to point to /opt/local/apache2/modules/libphp5.so which is the location my other php module was installed but now I cannot start by web service. I get an error 1000002 stating that there should be details in the error log but the error logs of the server admin app have nothing about php. Is there another place I should be looking for this error log? – user16390 Feb 24 '11 at 18:51
  • Which error logs did you look in? I'd check the apache error log (/var/log/apache2/error_log, visible in the Logs section of Web service in Server Admin) and the system log (/var/log/system.log, visible in the Logs section of the main server entry in Server Admin). – Gordon Davisson Feb 24 '11 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.