[英]Lion Server updating php from 5.3 to 5.4
I am trying to update our PHP version (Current: 5.3.15) to the latest 5.4.16 i used this link for my Lion Mac PHP Install and all worked well. 我正在尝试将我们的PHP版本(当前:5.3.15)更新为最新的5.4.16,我将此链接用于Lion Mac PHP Install,并且一切正常。
So then i went onto our Mountain Lion Mac Server and did the same but its still showing via phpinfo page as 5.3.15 same if i do a php -v via the terminal. 因此,然后我进入了我们的Mountain Lion Mac Server并执行了相同的操作,但如果我通过终端执行php -v,则仍通过phpinfo页面显示为5.3.15。
i understand that this install places it into the usr/local area whereas i believe the server is getting the php etc from /usr/bin/php and not the local. 我知道此安装会将其放入usr / local区域,而我认为服务器从/ usr / bin / php而不是本地获取了php等。
So how ca i update the main php scripting and not the local or link up the server to use the local updated version? 那么,如何才能更新主要的php脚本而不是本地的php或链接服务器以使用本地的更新版本?
Replace the default location with a link to the new version: 用指向新版本的链接替换默认位置:
sudo mv /usr/bin/php /usr/bin/php.orig
sudo ln -s /usr/local/bin/php /usr/bin/php
What does your $PATH
look like on the command line? 您的
$PATH
在命令行中是什么样的? You need the path to your PHP binary in /usr/local
to come before the path to the system's default installation of PHP. 您需要
/usr/local
PHP二进制文件路径位于系统默认PHP安装路径之前。
One alternative would be to install PHP in the same place as the default version, thus overwriting it. 一种选择是将PHP与默认版本安装在同一位置,从而覆盖它。
I'd be wary of only making a symbolic link from /usr/bin/php
to your local version of PHP. 我会警惕只将符号链接从
/usr/bin/php
链接到您的本地PHP版本。 This might work for executing PHP scripts, but when it comes time to compile custom extensions and what not, it could confuse phpize
and mess up your build process. 这可能对执行PHP脚本有效,但是到了编译自定义扩展名的时候,可能会混淆
phpize
并弄乱您的构建过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.