mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-09 15:36:36 +02:00
Update macOS Homebrew notes
This commit is contained in:
@@ -6,10 +6,9 @@ anchor: use_the_current_stable_version
|
||||
|
||||
## Use the Current Stable Version (7.2) {#use_the_current_stable_version_title}
|
||||
|
||||
If you are getting started with PHP, start with the current stable release of [PHP 7.2][php-release]. PHP 7.2 is very
|
||||
new, and adds many amazing [new features](#language_highlights) over the older 5.x versions. The engine has been largely re-written, and PHP is now even quicker than older versions.
|
||||
If you are getting started with PHP, start with the current stable release of [PHP 7.2][php-release]. PHP 7.x adds many [new features](#language_highlights) over the older 5.x versions. The engine has been largely re-written, and PHP is now even quicker than older versions.
|
||||
|
||||
Most commonly in the near future you will find PHP 5.x being used, and the latest 5.x version is 5.6. This is not a bad option, but you should try to upgrade to the latest stable quickly - PHP 5.6 [will not receive security updates beyond 2018](http://php.net/supported-versions.php). Upgrading is really quite easy, as there are not many [backwards compatibility breaks][php72-bc]. If you are not sure which version a function or feature is in, you can check the PHP documentation on the [php.net][php-docs] website.
|
||||
You should try to upgrade to the latest stable version quickly - PHP 5.6 [will not receive security updates beyond 2018](http://php.net/supported-versions.php). Upgrading is easy, as there are not many [backwards compatibility breaks][php72-bc]. If you are not sure which version a function or feature is in, you can check the PHP documentation on the [php.net][php-docs] website.
|
||||
|
||||
[php-release]: http://php.net/downloads.php
|
||||
[php-docs]: http://php.net/manual/
|
||||
|
@@ -5,18 +5,17 @@ anchor: mac_setup
|
||||
|
||||
## Mac Setup {#mac_setup_title}
|
||||
|
||||
OS X comes prepackaged with PHP but it is normally a little behind the latest stable. Mavericks has 5.4.17,
|
||||
Yosemite 5.5.9, El Capitan 5.5.29 and Sierra 5.6.24, but with PHP 7.1 out that is often not good enough.
|
||||
|
||||
There are multiple ways to install PHP on OS X.
|
||||
macOS comes prepackaged with PHP but it is normally a little behind the latest stable release. There are multiple ways to install the latest PHP version on macOS.
|
||||
|
||||
### Install PHP via Homebrew
|
||||
|
||||
[Homebrew] is a powerful package manager for OS X, which can help you install PHP and various extensions easily.
|
||||
[Homebrew PHP] is a repository that contains PHP-related "formulae" for Homebrew, and will let you install PHP.
|
||||
[Homebrew] is a package manager for macOS that helps you easily install PHP and various extensions. The Homebrew core repository provides "formulae" for PHP 5.6, 7.0, 7.1, and 7.2. Install the latest version with this command:
|
||||
|
||||
At this point, you can install `php53`, `php54`, `php55`, `php56`, `php70` or `php71` using the `brew install` command, and switch
|
||||
between them by modifying your `PATH` variable. Alternatively, you can use [brew-php-switcher][brew-php-switcher] which will switch automatically for you.
|
||||
```
|
||||
brew install php@7.2
|
||||
```
|
||||
|
||||
You can switch between Homebrew PHP versions by modifying your `PATH` variable. Alternatively, you can use [brew-php-switcher][brew-php-switcher] to switch PHP versions automatically.
|
||||
|
||||
### Install PHP via Macports
|
||||
|
||||
@@ -60,15 +59,14 @@ The solutions listed above mainly handle PHP itself, and do not supply things li
|
||||
"All-in-one" solutions such as [MAMP][mamp-downloads] and [XAMPP][xampp] will install these other bits of software for
|
||||
you and tie them all together, but ease of setup comes with a trade-off of flexibility.
|
||||
|
||||
|
||||
[Homebrew]: http://brew.sh/
|
||||
[Homebrew]: https://brew.sh/
|
||||
[Homebrew PHP]: https://github.com/Homebrew/homebrew-php#installation
|
||||
[MacPorts]: https://www.macports.org/install.php
|
||||
[phpbrew]: https://github.com/phpbrew/phpbrew
|
||||
[php-osx.liip.ch]: http://php-osx.liip.ch/
|
||||
[mac-compile]: http://php.net/install.macosx.compile
|
||||
[php-osx.liip.ch]: https://php-osx.liip.ch/
|
||||
[mac-compile]: https://secure.php.net/install.macosx.compile
|
||||
[xcode-gcc-substitution]: https://github.com/kennethreitz/osx-gcc-installer
|
||||
["Command Line Tools for XCode"]: https://developer.apple.com/downloads
|
||||
[mamp-downloads]: http://www.mamp.info/en/downloads/
|
||||
[xampp]: http://www.apachefriends.org/en/xampp.html
|
||||
[mamp-downloads]: https://www.mamp.info/en/downloads/
|
||||
[xampp]: https://www.apachefriends.org/index.html
|
||||
[brew-php-switcher]: https://github.com/philcook/brew-php-switcher
|
||||
|
Reference in New Issue
Block a user