开发者

Where is this PHP directive (include_path) being set?

From phpinfo() I can see the include_path directive is set to this:

include_path

.:/usr/lib/php:/usr/local/lib/php:/home/username/php
.:/usr/lib/php:/usr/local/lib/php

I cannot figure out where this is being set. It is not in the usual places: php.ini or an .htaccess file.

If it helps, the server is using cPanel, so it might have been set there, but I cannot find the setting there either.

This is something I set up, maybe two years ago, and for the life开发者_StackOverflow of me i can't remember what I did, so any insight would be appreciated.

Thanks.


To troubleshoot, If you have shell access, and you're using Apache, try

<Directory />
AllowOverride None
</Directory> 

In httpd.conf. Make sure to restart apache. Then see if the path changes. This will disable .htaccess overrides. I know you're saying it's not .htaccess, but it's worth a try to prove that it's not in an override.

Important: You should only do this if it's a development server or a live server that isn't relying on these features.


Anywhere you want it to be!

It's a config option that can be set at in point in PHP's initialization or execution.

  1. It's default value is in the system php.ini (installed in different places depending on the OS, poke around in /etc in *nix systems and C:\WINDOWS\system32 in... you guessed it... windows systems).
  2. If you're running mod_php under apache, you can set it per directory in .htaccess
  3. You can always change it runtime (in your php scripts) via ini_set('include_path', $somepath) or set_include_path($somepath) (keep in mind that this replaces the previous value)
  4. If you're running a console script, you can change it via php -d include_path=[WHATEVER PATH]

Sorry if this doesn't help you narrow the problem down, but maybe it'll jar your memory a bit about what you actually did?


You can override the php include path from an .htaccess file: http://cpanelhostingstuff.com/how-do-i-set-php-include_path/

You can also have php.ini files in subdirectories that take precedence over the global one: http://www.geeksengine.com/article/php-include-path.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜