So, you’re still using macOS Sierra because of old mac hardware or whatever reason. You can still using Homebrew, while you will get the following warning: Show Warning: You are using macOS 10.12. We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience while you are running this old version.
First, if you are still want to try it, what you need to do is verify that you have latest $ /usr/bin/xcodebuild -version Xcode 9.2 Build version 9C40b If you’re still using older version, you can
first remove the https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_9.2/Xcode_9.2.xip That’s about 5GB file. After downloaded, you can extract to $ sudo xcodebuild -license accept If everything is correct, you can update and upgrade Homebrew with commands: $ brew update $ brew upgrade When done, you can verify that some “probably” dependencies needs install/update with run brew doctor until it only show 1 warning, which is outdated operating system: $ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: You are using macOS 10.12. We (and Apple) do not provide support for this old version. You will encounter build failures with some formulae. Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC. You are responsible for resolving any issues you experience while you are running this old version. Now, we can follow to install php 7.4 for it at https://getgrav.org/blog/macos-catalina-apache-multiple-php-versions which the example is for macOS Catalina, that the steps can be used in macOS Sierra. On $ brew install And that’s it, if everything is correct, now you have PHP 7.4. BonusYou can add $ git clone https://github.com/xdebug/xdebug $ cd xdebug $ git checkout 2.8.1 $ phpize $ ./configure --enable-xdebug $ sudo make $ sudo make install After it, add the following line to zend_extension="/usr/local/Cellar/php/7.4.0/pecl/20190902/xdebug.so" zend_extension pointed to real location of xdebug.so installed above. The alternative can be via $ sudo pecl install xdebug If everying correct, you will get PHP 7.4 with Xdebug 2.8.1 like the following On Mac, PHP can be easily upgraded to 7.4 with Homebrew. However, the command line may continue to show the previous version. Here's how to fix that. Upgrade to PHP 7.4 with Homebrew on Mac is a very succinct article by @brendt_gd that boils it down to two simple commands: The problem I ran into was that my PHP CLI in the terminal remained linked to the previous version. Checking the version, before and after running the brew command produced the same result:
Just to make sure 7.4 was actually installed, I ran the upgrade command again, then checked the actual location of PHP 7.4:
To switch the PHP CLI to 7.4, first I ran Homebrew's unlink/link command:
This should produce an output similar to this:
Finally, you need to export the proper path variable
for the PHP executable in either
Locate the following (or similar) line...
... and change it to:
Finally, run For good measure, close the terminal window and open a fresh one. If you now run
Liked this article? Share it on your favorite platform. How do I update PHP 7.4 on Mac?6 Answers. brew install [email protected].. brew link --force --overwrite [email protected].. brew services start [email protected].. export PATH="/usr/local/opt/[email protected]/bin:$PATH". export PATH="/usr/local/opt/[email protected]/sbin:$PATH". How do I update PHP version on Mac?To update the PHP version, update the brew using the command brew update . Then, use the command brew upgrade php . It upgrades the current version to the latest version of PHP. Then, restart the webserver to see the changes.
How do I upgrade PHP to 8.0 on Mac?Upgrading with Homebrew. Normal upgrade. brew upgrade php.. Upgrade with shivammathur/homebrew-php. brew tap shivammathur/php brew install shivammathur/php/[email protected]. To switch between versions, use the following command: brew link --overwrite --force [email protected]. ... . Next steps. Check the current version by running php -v : php -v.. How do I check my PHP version on Mac?The php -v command works on Linux, macOS, Windows, and other supported systems. Its output contains the PHP version number, build date, and copyright information. Note: If there is more than one PHP version installed on the server, the php -v command shows the default command-line interface (CLI) version.
|