OSX Mavericks - Upgraded PHP not loading

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I was wondering if someone could help me.

Im running https://forum.tuteehub.com/tag/mavericks">mavericks OSX ... When i type php -v i get the following:

PHP 5.4.24

I needed to upgrade the PHP version, so i followed an https://forum.tuteehub.com/tag/online">online guide and updated via the command

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

The installation seems to be successful, and installs the new php to

/usr/local/php5/bin/php

But when i run php -v from the command line, i still get the same php version as in the beginning.

If i run /usr/local/php5/bin/php -v i get the correct version im looking for, which is

PHP 5.5.13

Also, when i run which php i get

/usr/bin/php

How do i https://forum.tuteehub.com/tag/change">change it so that when i type php -v it shows the updated version?

One more https://forum.tuteehub.com/tag/thing">thing .. Im using the zsh shell.

Any help would be greatly appreciated.

Cheers,

profilepic.png
manpreet 2 years ago

Unix shells look for an environment variable called PATH to tell them a prioritized list of directory paths in which to look for commands (executable files). Your PATH variable needs to have /usr/local/php5/bin before /usr/bin if you want it to find your new custom local version of PHP instead of the default system version.

To do this on the fly, enter this command:

PATH="/usr/local/php5/bin:$PATH"

To make this change stick for your account, add that command to the appropriate startup script for zsh, such as .zshenv.zshrc, or .zshprofile.

To make this change stick for all shells for all accounts on your system, add /usr/local/php5/bin to the top of /etc/paths.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.