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

General Tech Bugs & Fixes 3 years ago

3.07K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 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

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.

Similar Forum