Why is the PHP version different in phpinfo() and CLI?

General Tech Bugs & Fixes 2 years ago

0 1 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 (1)

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

 

I realized that there is a miss matching between the PHP version reported by phpinfo() and php -v(in the CLI).

phpinfo():  5.5.24
php -v: 5.6.9

I am working on a Mac OS X 10.10 (Yosemite) and installed a library (php-version) to try to manage the PHP versions.

It reports me 3 different versions installed on my laptop:

  5.4.41
  5.5.25
* 5.6.9

I would like to set the same version of PHP in both Apache and CLI.

How can I tell Apache which PHP version use?

I tried to write this line in my httpd.conf:

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

Then:

sudo apachectl restart

But all this not solve the problem… In my PHP info I still have: 5.5.24

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.