duan19740319 2012-08-11 10:21
浏览 6
已采纳

山狮改变PHP的位置

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

It installs 5.4 to /usr/local/php5

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

And running php -v returns 5.3.13

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

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

Thanks

  • 写回答

1条回答 默认 最新

  • dqdt45183 2012-08-11 10:39
    关注

    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
    

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

    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.

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP