douyi3833 2014-07-08 19:11
浏览 233
已采纳

使用MacPort切换PHP版本

I've installed PHP 5.4 with MacPorts, using all the ports I had on my current PHP 5.3. I then (foolishly) ran the command sudo port select --set php php54 and received Selecting 'php54' for 'php' succeeded. 'php54' is now active.

However, I couldn't run any of my current PHP pages, receiving a 'Forbidden' error from Apache. I decided to switch back to 5.3, and ran sudo port select --set php php5 only to receive Selecting 'php5' for 'php' failed: The specified version 'php5' is not valid.. I tried the same with php53 - and got the same message.

To verify what's installed I ran port installed php* and got:

php5 @5.3.28_0+apache2+pear (active) php5-apc @3.1.9_1 (active) php5-curl @5.3.28_0 (active) php5-iconv @5.3.28_0 (active) php5-mbstring @5.3.28_0 (active) php5-mcrypt @5.3.28_0 (active) php5-memcache @2.2.7_0 (active) php5-mysql @5.3.28_0+mysqlnd (active) php5-openssl @5.3.28_0 (active) php5-xdebug @2.2.5_0 (active) php54 @5.4.30_0+libedit (active) php54-apache2handler @5.4.30_0 (active) php54-APC @3.1.13_0 (active) php54-curl @5.4.30_0 (active) php54-iconv @5.4.30_0 (active) php54-mbstring @5.4.30_0 (active) php54-mcrypt @5.4.30_0 (active) php54-memcache @2.2.7_0 (active) php54-mysql @5.4.30_0+mysqlnd (active) php54-openssl @5.4.30_0 (active) php54-xdebug @2.2.5_0 (active) php_select @1.0_0 (active)

So, there are 2 version of PHP installed. How do I switch back to PHP 5.3? And why is running 5.4 encounters a permissions issue?

  • 写回答

2条回答 默认 最新

  • douba1214 2014-07-12 19:40
    关注

    Well, I haven't been able to revert to 5.3. I ended up fixing the access rights error, and I'm currently using 5.4. Fortunately, it's backwards compatible (at least, I have not hit on anything significant yet).

    Bottom line - be careful with Ports activations - there may be no (known) going back.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料