[英]Is it possible to know where the default PHP include_path is being set?
I have a bunch of PHP applications running on a remote webserver. 我有一堆在远程Web服务器上运行的PHP应用程序。 For each of them I do var_dump(get_include_path())
and I get this: .:/usr/share/pear:/usr/share/php
. 对于他们每个人,我都做var_dump(get_include_path())
,我得到了这个: .:/usr/share/pear:/usr/share/php
。 Where does this value come from? 这个价值从何而来? I know that none of my apps deliberately change the include path. 我知道我的应用程序都没有故意更改包含路径。 What I mean is there is nothing like set_include_path()
or ini_set('include_path')
in the code. 我的意思是在代码中没有像set_include_path()
或ini_set('include_path')
的东西。 There is also nothing like php_value include_path
in the .htaccess files. .htaccess文件中也没有类似php_value include_path
的文件。 To be 100% sure of it I am actually creating a brand new app with nothing more than a blank index.php (except for the var_dump) and I still get the same included path. 为了确保100%的正确性,我实际上是在创建一个全新的应用程序,其中只包含一个空白的index.php(除了var_dump除外),我仍然得到相同的包含路径。 I am pretty sure it is a global server configuration. 我很确定这是一个全局服务器配置。
My server info is: Linux version 2.6.9-89.0.20.ELxenU (Red Hat 3.4.6-11)
我的服务器信息是: Linux version 2.6.9-89.0.20.ELxenU (Red Hat 3.4.6-11)
Is there any way to detect where this value is being set? 有什么方法可以检测到该值的设置位置? I do have access to the server but I am no sys admin so my Linux capabilities are rather limited. 我确实可以访问服务器,但我不是系统管理员,所以我的Linux功能受到很大限制。 I was hoping for some advice. 我希望能得到一些建议。
What I did so far is checked the php.ini and httpd.conf files. 我到目前为止所做的是检查php.ini和httpd.conf文件。 I know there might be more than one version of these files so to make sure I am looking in the right place: 我知道这些文件可能有多个版本,因此请确保在正确的位置查找:
For php.ini 对于php.ini
phpinfo()
我检查了phpinfo()
的输出 $ php --ini
. 我运行了这个命令$ php --ini
。 Besides the location of php.ini I found a bunch of other *.ini files parsed by PHP but none of them seem to do anything with paths 除了php.ini的位置,我还发现了PHP解析的其他* .ini文件,但是它们似乎都没有对路径做任何事情 For httpd.conf 对于httpd.conf
/usr/sbin/httpd -V | grep HTTPD_ROOT
我运行了此命令/usr/sbin/httpd -V | grep HTTPD_ROOT
/usr/sbin/httpd -V | grep HTTPD_ROOT
/usr/sbin/httpd -V | grep SERVER_CONFIG_FILE
我运行了此命令/usr/sbin/httpd -V | grep SERVER_CONFIG_FILE
/usr/sbin/httpd -V | grep SERVER_CONFIG_FILE
I am not sure if PEAR is installed or if it has anything to do with this. 我不确定是否安装了PEAR或与此有关。 Running $ pear
gives me Command not found
. 运行$ pear
给我Command not found
。
Any help is greatly appreciated, thanks. 非常感谢任何帮助,谢谢。
Take a look at 看一眼
/usr/include/php5/main/build-defs.h:79: /usr/include/php5/main/build-defs.h:79:
#define PHP_INCLUDE_PATH ".:/usr/share/php:/usr/share/pear"
(Sorry, no Red Hat here, distro is Debian). (对不起,这里没有Red Hat,发行版是Debian)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.