amique
amique

Reputation: 2236

different version php on command line and in apache

I am using mac 10.8 and I have installed php 5.5. At command line php -v show version 5.5. but when I starts mac's apache server with phpinfo(), it show version 5.4.

Can anyone please help me how to make apache to use version 5.5

Thanks

Upvotes: 9

Views: 10218

Answers (2)

Peter
Peter

Reputation: 171

  1. find out the conf/httpd.conf and conf.d/*.conf

  2. find the tag like this: LoadModule php5_module modules/libphp5.so

  3. make the change to correct php installation folder like this: LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so

This will change your php model (php version) in Apache

Search on your local desk: find / -name "libphp5.so"

Regarding the correct so file: libphp5.so not being created after compiling and prefix directory not created

[update]

http://www.howtoforge.com/centos-5.6-php53-common-conflicts-with-php-common

1) update yum to include latest php

2) For 64bit systems, you can find the correct packages here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/

For 32bit systems, the correct packages are here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/

3) (replace to the correct URL and file name which you want to have, check it from step "2)")

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-11.ius.el5.noarch.rpm

4) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

5) yum install yum-plugin-replace

6) You can now replace your PHP old version packages with the PHP new version packages from IUS like this:

yum replace php --replace-with php55w

You can search for further php55w packages like this:

yum search php53u

Upvotes: 9

Mr. Crowley
Mr. Crowley

Reputation: 3403

If you uncommented the line LoadModule php5_module /usr/local/php5/libphp5.so in httpd.conf comment it again, then add the line export PATH=~/bin:/usr/local/php5/bin:$PATH in .bash_profile This did the trick for me. Note: i have installed php5.5.5 via liip on OS X Mavericks

Upvotes: 1

Related Questions