9

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

5
  • How did you install php55 ? Did you compile yourself? Commented Oct 24, 2013 at 0:38
  • Have you got any previous installations of PHP, if so.. Check where your actual PHP5.5 ini file is, then check if phpinfo() corresponds with the correct loaded configuration file, if not. Let me know Commented Oct 24, 2013 at 0:44
  • the apache is read php.ini file from /etc and if i do php -i on command line it show 'Configuration File (php.ini) Path => /usr/local/etc/php/5.5 Loaded Configuration File => /usr/local/etc/php/5.5/php.ini' should I create a link to 5.5/php.ini in /etc directory ? Commented Oct 24, 2013 at 0:51
  • Never used homebrew, but it looks like every php installation (from homebrew-php) builds a .so php module. Please check the LoadModule php5_module Path in the Apache Configuration file. You'll probably have to change the Path to the php55 Module. Path to the new .so php Module should look like this: #{HOMEBREW_PREFIX}/opt/php55[/maybe/some/dirs/here/idk]/libexec/apache2/libphp5.so Commented Oct 24, 2013 at 1:02
  • I could not find this file on location mentioned above. I uninstalled the php55 and installed php55 xdebug and phpunit again via brew which solved the problem. Anyways thanks for your help Commented Oct 24, 2013 at 4:37

2 Answers 2

9
  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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.