I would tring to update my php version to the version 5.4.
When I'm looking via /usr/local/bin/php -v in the console I see the version 5.4.3 and with php -v it tell me there is the version 5.3.10 installed.
How can I remove the older version?
Update: As of early 2014, you are probably better of installing from http://php-osx.liip.ch/ builds as it contains most extensions. In case you really do need to compile your own, follow the original answer.
Original answer:
Mac comes with a preinstalled php you can easily overwrite.
This is a list of steps I take to update the php I have installed:
Prerequisites:
Building and installing php:
php -i | head
in the console. What you want is to configure your new php with these flags to ensure you have proper pcre support and everything works just fine../configure
script with the flags you just gotmake
and sudo make install
afterwards. That will actually replace the original php distributed with OS X.And dont forget to run make test
...
Ex.: my workflow for building php
wget http://url_to/php_source.tar.gz
tar -zxvf php_source.tar.gz
cd php_source/
php -i | head
./configure --prefix=/usr --with-snmp # ... same flags as previous build
make
sudo make install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With