PHP 5.4 Installation on Mountain Lion

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 just installed Mountain Lion, and of course I've had to set up Xcode Command Line Tools, reinstall Git, and do other things to get up and running again for programming. Naturally, PHP was pushed back to 5.3 from 5.4 that I previously had installed when my MacBook Pro was running Lion. I ran through the process downloading PHP 5.4, unzipping it (tar xf php5.4), configuring it (./configure with and without options), making it (make), running the make test (make test), and installing the make (sudo make install). When I ran configuration with options it did not allow me to make and when I ran without configuration options it failed to pass make test a few times (when this occurred I sent the information to Zend). When it did pass make test though, it said that it installed successfully, but when I would check the version (php -v) it still comes up with PHP 5.3. I've done this almost nine times with restarts and re-downloading the package every time; no sauce. Does anyone have any ideas what could possibly be going wrong? Any help on this issue would be greatly appreciated.

profilepic.png
manpreet 2 years ago

 

I strongly suggest you use the package installer or use a full stack of configuration options when compiling, including the --prefix option so you know where the binary gets installed to.

I can only guess PHP 5.4 installed itself into /usr/local/bin or somewhere else and didn't just overwrite the default binary in /usr/bin. And you seem to have not modified your PATH variable to prioritise the bin directory of /usr/local with e.g. PATH="/usr/local/bin:$PATH" in your .bash_profile. So, it's expected running php will still use /usr/bin/php and not /usr/local/bin/php.

Alternatively, you could just symlink the new php binary to /usr/bin/php, (delete or rename the default binary before that):

ln -s /usr/local/bin/php /usr/bin/php

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.

tuteehub community

Join Our Community Today

Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.

tuteehub community