PHP

如何确认我apache加载的php的真实路径

在服务器上apahce和php都是编译安装的,编译安装了两个不同版本的php,情况如下:[code][root@web3 ~]# ls /usr/local/php5. php5.3.6/ php5.4.45/ [/code]我怎么知道我的apache使用的是哪个目录下的php?
已邀请:

OS小编 - 开源技术社区小编,我就是这么爱学习!

赞同来自: 空心菜 Geek小A

编译php的时候如果指定了不同的安装目录,那么apache加载的libphp5.so文件里面就包括了PHP编译时指定的安装目录。
 
所以你想知道你apache使用的php的加载路径,进入到apache安装目录下面的modules下面有个libphp5.so,执行示例如下:
[root@test modules]# strings libphp5.so |grep --color configure
'./configure' '--prefix=/usr/local/php5.4.45' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-mbstring' '--with-curl' '--with-openssl' '--with-zlib' '--enable-sockets' '--enable-ftp'
Unable to find the wrapper "%s" - did you forget to enable it when you configured PHP?
Unable to find the socket transport "%s" - did you forget to enable it when you configured PHP?
如上操作就能看出来了。

要回复问题请先登录注册