2012-11-25 50 views
3

我在OSX Lion 10.7.5上。截至How do I upgrade PHP in Mac OS X?勸,我用:升級到5.4,但「php -v」仍返回舊版本

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4 

一切似乎進展順利,沒有任何錯誤,我是一個64位系統,等等,但是當我運行「PHP -v」我仍看到相同的版本我曾經(5.3.15)。在1-10的範圍內,當涉及通過命令行安裝東西時,我可能是2,因此,請將其納入任何響應中。

UPDATE:我把在終端輸出細看運行curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4後,我注意到以下幾點:

Installing package tools-memcached into root/
./pkg/pre-install 
pkg/pre-install 
Skipping existing directory 
Skipping existing directory usr/ 
Skipping existing directory usr/local/ 

...然後在安裝結束:

Create symlink /usr/local/php5/entropy-php.conf /etc/apache2/other/+php-osx.conf 
Removed /usr/lib from DYLD_LIBRARY_PATH in /usr/sbin/envvars 
Restarting Apache 
httpd: Could not reliably determine the server's fully qualified domain name 

燦有人精確地闡述了這意味着什麼?正如評論中所解釋的那樣,似乎我已經安​​裝了這些文件,但是,我無法解決似乎是$ PATH問題的問題。

+1

老版本的PHP被首次發現在'$ PATH'。要查看你從CLI調用哪一個,請執行'which php'。這可能會返回一些PHP 5.3版本。 –

+0

重新啓動你的shell。 – soulseekah

+0

@soulseekah:重新啓動沒有幫助,但謝謝! – vtacreative

回答

4

創建符號鏈接到新的PHP的路徑中安裝這樣的:

ln -s /usr/local/php5/bin/php php 
+0

如果它返回'ln:php:File exists'? – Pathros

1

如果你使用Apache首先禁用當前的PHP模塊

須藤a2dismod PHP5
須藤a2dismod PHP5。 6

然後啓用

須藤a2enmod php7.0

,並重新啓動Apache

須藤服務的Apache2重啓