mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-06 14:06:34 +02:00
Update information about PHP 7
This commit is contained in:
@@ -6,7 +6,7 @@ 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.0 out that is often not good enough.
|
||||
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.
|
||||
|
||||
@@ -29,14 +29,14 @@ MacPorts supports pre-compiled binaries, so you don't need to recompile every
|
||||
dependency from the source tarball files, it saves your life if you don't
|
||||
have any package installed on your system.
|
||||
|
||||
At this point, you can install `php54`, `php55`, `php56` or `php70` using the `port install` command, for example:
|
||||
At this point, you can install `php54`, `php55`, `php56`, `php70` or `php71` using the `port install` command, for example:
|
||||
|
||||
sudo port install php56
|
||||
sudo port install php70
|
||||
sudo port install php71
|
||||
|
||||
And you can run `select` command to switch your active PHP:
|
||||
|
||||
sudo port select --set php php70
|
||||
sudo port select --set php php71
|
||||
|
||||
### Install PHP via phpbrew
|
||||
|
||||
@@ -45,7 +45,7 @@ applications/projects require different versions of PHP, and you are not using v
|
||||
|
||||
### Install PHP via Liip's binary installer
|
||||
|
||||
Another popular option is [php-osx.liip.ch] which provides one liner installation methods for versions 5.3 through 7.0.
|
||||
Another popular option is [php-osx.liip.ch] which provides one liner installation methods for versions 5.3 through 7.1.
|
||||
It doesn't overwrite the PHP binaries installed by Apple, but installs everything in a separate location (/usr/local/php5).
|
||||
|
||||
### Compile from Source
|
||||
|
@@ -18,8 +18,8 @@ To save digging into your `php.ini` settings to see which module you are using,
|
||||
in your editor of choice. If any functions such as `mysql_connect()` and `mysql_query()` show up, then `mysql` is
|
||||
in use.
|
||||
|
||||
Even if you are not using PHP 7.0 yet, failing to consider this upgrade as soon as possible will lead to greater
|
||||
hardship when the PHP 7.0 upgrade does come about. The best option is to replace mysql usage with [mysqli] or [PDO] in
|
||||
Even if you are not using PHP 7.x yet, failing to consider this upgrade as soon as possible will lead to greater
|
||||
hardship when the PHP 7.x upgrade does come about. The best option is to replace mysql usage with [mysqli] or [PDO] in
|
||||
your applications within your own development schedules so you won't be rushed later on.
|
||||
|
||||
**If you are upgrading from [mysql] to [mysqli], beware lazy upgrade guides that suggest you can simply find and replace `mysql_*` with `mysqli_*`. Not only is that a gross oversimplification, it misses out on the advantages that mysqli provides, such as parameter binding, which is also offered in [PDO][pdo].**
|
||||
|
Reference in New Issue
Block a user