Unintended multiple PHP versions on OSX

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

For an application i'm making i need the PHP stats functions. My OSX (10.11) came with the default PHP 5.5, but i needed 7.0 to install the PECL stats package so i updated my local PHP version to version 7 with the shellscript on liip.ch, like so:

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

Now i ended up with, apparently, two php versions.

When i run phpinfo() on a page i get PHP Version 7.0.2 and when (in the terminal) i do php -v i end up with PHP 5.5.27.

It seems that for my web applications the update works (i got a stricter notice for example), but when i try to install the stats package with pecl install stats i get pecl/stats requires PHP (version >= 7.0.0), installed version is 5.5.27

which php gives me just one result: /usr/bin/php

How can i tell my terminal to 'use' php 7 as well?

profilepic.png
manpreet 2 years ago

You don't need to uninstall, and it's normal what happened. When you install Apache gets to use the https://forum.tuteehub.com/tag/version">version you installed but the env path for console remains with the https://forum.tuteehub.com/tag/default">default osx php https://forum.tuteehub.com/tag/version">version.

You should read Frequently Asked Questions on the page http://php-osx.liip.ch/. Look for the first item.


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.