mac下快速安装php 5.4

手头的笔记本升级到了OS X 10.8了,但是偶尔还需要写点php调剂一下。看看自带的php版本?

PHP 5.3.13 with Suhosin-Patch (cli) (built: Jun 20 2012 17:05:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

对于追新族来说,必须得升级到php 5.4才开心。借助homebrew很快完成升级:

安装过程

三行即可。


brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54

这样安装的php路径在/usr/local/bin/php,版本信息:

/usr/local/bin/php -v
PHP 5.4.4 (cli) (built: Jul 27 2012 08:42:32)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

3 replies on “mac下快速安装php 5.4”

  1. 不能用啊,装完以后根本没有usr/local/bin下面的php ,我直接用php -v,显示的还是5.3.15

  2. 这说明你没有安装成功,我现在都已经安装5.5了


    /usr/local/bin/php -v
    PHP 5.5.0 (cli) (built: Jul 4 2013 06:08:18)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.5.0-dev, Copyright (c) 1998-2013 Zend Technologies

Comments are closed.