在做php項目中,提示“Warning. PHP 5.6 or newer is required. Please, upgrade your local PHP installation.” 通過phpinfo()查看,當前的版本號是php5.5,於是上網搜索如何快速升級php。
參考網址: http://coolestguidesontheplanet.com/upgrade-php-on-osx/
真的是非常方便。僅僅需要一條命令:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
這個命令會執行很長時間,大概20分鍾左右
最終升級完成並成功后,會有如下的輸出
Executing post-install script /tmp/5.6-10.10-frontenddev-post-install Create symlink /usr/local/php5/entropy-php.conf /etc/apache2/other/+php-osx.conf Restarting Apache AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using caoxindeMacBook-Pro.local. Set the 'ServerName' directive globally to suppress this message Syntax OK
再次通過 phpinfo() 查看,php的版本已經完成升級。