Apache is running the wrong PHP version on Mavericks

I am trying to upgrade my PHP version from 5.4 to 5.5 but Apache is not playing. I've looked elsewhere for this and it seems like the solution is to add the following line to httpd.conf

:

LoadModule php5_module    /usr/local/opt/php55/libexec/apache2/libphp5.so

      

I did and it still doesn't work. From the command line, everything seems to be correct:

Andres-MacBook-Air:~ fratelli$ which php
/usr/local/opt/php55/bin/php
Andres-MacBook-Air:~ fratelli$ php -v
PHP 5.5.16 (cli) (built: Sep 12 2014 04:34:10) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Andres-MacBook-Air:~ fratelli$ 

      

As I said, I added a directive LoadModule

to the file https.conf

located at /private//etc/apache2

and then restart apache:

sudo apachectl restart

      

On my page, I call phpinfo()

which tells me that I am using PHP Version 5.4.24. Does anyone know how to fix this?

Best.

Edit: Does this help?

Andres-MacBook-Air:apache2 fratelli$ apachectl -M | grep php
[Sat Sep 13 03:11:50 2014] [warn] module php5_module is already loaded, skipping
httpd: Could not reliably determine the server fully qualified domain name, using Andres-MacBook-Air.local for ServerName
Syntax OK
 php5_module (shared)

      

Edit: I have no idea where Apache is downloading PHP from. I just edited my file /private/etc/httpd.conf

removing all directives LoadModule

referencing PHP and it still works (5.4 though). I'm pretty sure this is the wrong file.

Edit: this seems to be the wrong file. There's another one in /etc/apache2

. Let's try to try.

Edit: I'm now confused:

Andres-MacBook-Air:apache2 fratelli$ ls -l /private/etc/apache2/httpd.conf
-rwxrwxrwx  1 root  wheel  18196 Sep 13 03:29 /private/etc/apache2/httpd.conf
Andres-MacBook-Air:apache2 fratelli$ ls -l /etc/apache2/httpd.conf
-rwxrwxrwx  1 root  wheel  18196 Sep 13 03:29 /etc/apache2/httpd.conf

      

Editing one also changes the other, but neither is a symbolic link.

+3


source to share


1 answer


Use this website. http://php-osx.liip.ch/ You can upgrade to 5.5 or 5.6. I have updated multiple Macs using one ssh command. This should fix everything on your mac and get you to 5.5 or 5.6, which is now stable.

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

      

or

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5

      

My Apache has a file here. / etc / apache 2 / other / + php-osx.conf with the following path.

LoadModule php5_module  /usr/local/php5/libphp5.so

      

On the command line



which php

      

and he should

/usr/local/php5/bin/php

      

In my httpd.conf libphp5.so is actually commented out and there is no PHP reference.

#LoadModule php5_module        libexec/apache2/libphp5.so

      

Also make sure you "RESTART APACHE" to see any changes. Unless you want to reload the PHP5.5 library and you won't see any changes.

+4


source







All Articles