山狮更改php位置

编程入门 行业动态 更新时间:2024-10-23 21:33:42
本文介绍了山狮更改php位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

升级到 Mountain Lion 后,我使用这一行 bash 脚本安装了 php 5.4 php-osx.liip.ch/

After upgrading to Mountain Lion I used this one line bash script to install php 5.4 php-osx.liip.ch/

它将 5.4 安装到/usr/local/php5

It installs 5.4 to /usr/local/php5

如果我运行 which php 我得到/usr/bin/php

If i run which php I get /usr/bin/php

运行 php -v 返回 5.3.13

And running php -v returns 5.3.13

如何告诉Mountain Lion使用/usr/local/php5中的php

How do tell Mountain Lion to use the php in /usr/local/php5

我是否还需要更改 Apache htttpd.conf 才能使用新版本的 php?

Will I also have to change Apache htttpd.conf to use the new version of php?

谢谢

推荐答案

这很难,你只需链接到新的 php 文件:

This is the hard way, you just link to the new php file:

$ sudo mv /usr/bin/php /usr/bin/php53 && sudo ln -s /usr/local/php5/bin/php /usr/bin/php

根据真正的php5二进制路径更改php5 bin路径,因为我不知道正确的二进制文件在哪里.

Change the php5 bin path according to the real php5 binary path since I have no idea where the correct binary is.

但我宁愿尝试在命令行上只使用 php5 因为这可能使用的是 PHP5.4 版本,因为 /usr/local 通常在$PATH 也是.

But I'd rather try to use just php5 on the command line since this is probably using the PHP5.4 version because /usr/local is usually in the $PATH as well.

您可以通过命令行中的 echo $PATH 查看哪些路径被检查.你可以通过使用 export PATH=/usr/local/php5:$PATH 或类似的东西来添加一些东西.您也可以将该行添加到 ~/.bash_profile 文件中,以便将其存储以备后用.

You see which paths are checked by just echo $PATH on your command line. You may just add something to that by using export PATH=/usr/local/php5:$PATH or similar. You can add that line to the ~/.bash_profile file as well to store that for any later use.

更多推荐

山狮更改php位置

本文发布于:2023-10-16 16:10:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1498073.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:位置   php

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!