Simon Davies
Simon Davies

Reputation: 3684

Lion Server updating php from 5.3 to 5.4

I am trying to update our PHP version (Current: 5.3.15) to the latest 5.4.16 i used this link for my Lion Mac PHP Install and all worked well.

So then i went onto our Mountain Lion Mac Server and did the same but its still showing via phpinfo page as 5.3.15 same if i do a php -v via the terminal.

i understand that this install places it into the usr/local area whereas i believe the server is getting the php etc from /usr/bin/php and not the local.

So how ca i update the main php scripting and not the local or link up the server to use the local updated version?

Upvotes: 1

Views: 166

Answers (2)

curtisdf
curtisdf

Reputation: 4210

What does your $PATH look like on the command line? You need the path to your PHP binary in /usr/local to come before the path to the system's default installation of PHP.

One alternative would be to install PHP in the same place as the default version, thus overwriting it.

I'd be wary of only making a symbolic link from /usr/bin/php to your local version of PHP. This might work for executing PHP scripts, but when it comes time to compile custom extensions and what not, it could confuse phpize and mess up your build process.

Upvotes: 0

Barmar
Barmar

Reputation: 782489

Replace the default location with a link to the new version:

sudo mv /usr/bin/php /usr/bin/php.orig
sudo ln -s /usr/local/bin/php /usr/bin/php

Upvotes: 1

Related Questions