简体   繁体   中英

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. For each of them I do var_dump(get_include_path()) and I get this: .:/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. There is also nothing like php_value include_path in the .htaccess files. 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. 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)

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. I was hoping for some advice.

What I did so far is checked the php.ini and httpd.conf files. 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

  • I checked the output of phpinfo()
  • I ran this command $ 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

For httpd.conf

  • I ran this command /usr/sbin/httpd -V | grep HTTPD_ROOT /usr/sbin/httpd -V | grep HTTPD_ROOT
  • I ran this command /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. Running $ pear gives me Command not found .

Any help is greatly appreciated, thanks.

Take a look at

/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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM