PHP 指令 (include_path) 在哪里设置?
从 phpinfo()
我可以看到 include_path 指令设置为:
include_path
.:/usr/lib/php:/usr/local/lib/php:/home/username/php
.:/usr/lib/php:/usr/local/lib/php
我无法弄清楚它是在哪里设置的。它不在通常的位置:php.ini
或 .htaccess
文件。
如果有帮助,服务器正在使用cPanel
,因此它可能已在那里设置,但我也找不到那里的设置。
这是我大约两年前建立的,我一生都不记得我做了什么,所以任何见解将不胜感激。
谢谢。
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 of me i can't remember what I did, so any insight would be appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要进行故障排除,如果您有 shell 访问权限,并且正在使用 Apache,请尝试
在 httpd.conf 中。确保重新启动阿帕奇。然后看看路径是否改变。这将禁用 .htaccess 覆盖。我知道你是说它不是 .htaccess,但值得尝试证明它不在覆盖中。
重要提示:仅当开发服务器或实时服务器不依赖这些功能时,您才应该执行此操作。
To troubleshoot, If you have shell access, and you're using Apache, try
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.
任何你想要的地方!
它是一个配置选项,可以在 PHP 初始化或执行时进行设置。
/etc
和C:\WINDOWS\system32
中查看在......你猜对了......Windows系统)。.htaccess
中的每个目录中设置它ini_set('include_path', $somepath) 在运行时(在您的 php 脚本中)更改它
或set_include_path($somepath)
(请记住,这会替换之前的值)抱歉,如果这不能帮助您缩小问题范围,但也许它会让您对您实际做了什么产生一些记忆?
Anywhere you want it to be!
It's a config option that can be set at in point in PHP's initialization or execution.
/etc
in *nix systems andC:\WINDOWS\system32
in... you guessed it... windows systems)..htaccess
ini_set('include_path', $somepath)
orset_include_path($somepath)
(keep in mind that this replaces the previous value)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?
您可以覆盖 .htaccess 文件中的 php 包含路径: http://cpanelhostingstuff .com/how-do-i-set-php-include_path/
您还可以在子目录中放置 php.ini 文件,这些文件优先于全局文件:http://www.geeksengine.com/article/php-include-path.html
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