终端显示错误的php版本(Snow Leopard) [英] Terminal displays wrong php version (Snow Leopard)

查看:66
本文介绍了终端显示错误的php版本(Snow Leopard)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要将php降级到5.2.x,因此我遵循了本教程: http://andreys.info/blog/2010-03-25/compile-php-5-2-on-osx-10-6-snow-leopard#comment-631

Need to downgrade php to 5.2.x, so I followed this tutorial: http://andreys.info/blog/2010-03-25/compile-php-5-2-on-osx-10-6-snow-leopard#comment-631

我在安装了xcode的雪豹10.6.4上.

I'm on snow leopard 10.6.4, with xcode installed.

因此,我编译了php5.2.x并完成了本教程.在htp://localhost的浏览器中加载的phpinfo()表示5.2.x,太好了!但是,终端命令"php --version"显示为5.3.x?

So I compiled php5.2.x and completed the tutorial. phpinfo() loaded within the browser at htp://localhost says 5.2.x, Great!! But, Terminal command "php --version" says 5.3.x ??

在编译/安装php5.2.x时,新的模块文件在此处替换了php5.3.x模块: /usr/libexec/apache2/libphp5.so

While compiling/installing php5.2.x, the new module file replaced the php5.3.x module here: /usr/libexec/apache2/libphp5.so

  1. 那么Terminal从哪里获得5.3.x?
  2. 我要加载两个PHP版本吗?
  3. 我什至应该在乎吗?

推荐答案

  1. 使用which php检查.这应该告诉您正在使用哪个.
  2. 是的,看起来您有两个安装在不同的位置.
  3. 是的,请注意在哪里使用了什么.拥有多个版本是绝对有效的(至少在开发或测试系统上),但是您始终应该注意所使用的版本.
  1. Check using which php. This should tell you which is being used.
  2. Yes, looks like you have two installed at different locations.
  3. Yes, mind what's being used where. Having multiple versions is absolutely valid (at least on a development or testing system) but you always should be aware of the versions being used.

这篇关于终端显示错误的php版本(Snow Leopard)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆