PHP 指令 (include_path) 在哪里设置?

发布于 2024-11-08 04:26:49 字数 390 浏览 5 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空气里的味道 2024-11-15 04:26:49

要进行故障排除,如果您有 shell 访问权限,并且正在使用 Apache,请尝试

<Directory />
AllowOverride None
</Directory> 

httpd.conf 中。确保重新启动阿帕奇。然后看看路径是否改变。这将禁用 .htaccess 覆盖。我知道你是说它不是 .htaccess,但值得尝试证明它不在覆盖中。

重要提示:仅当开发服务器或实时服务器不依赖这些功能时,您才应该执行此操作。

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.

ゞ记忆︶ㄣ 2024-11-15 04:26:49

任何你想要的地方!

它是一个配置选项,可以在 PHP 初始化或执行时进行设置。

  1. 它的默认值在系统 php.ini 中(根据操作系统安装在不同的位置,在 *nix 系统中的 /etcC:\WINDOWS\system32 中查看在......你猜对了......Windows系统)。
  2. 如果您在 apache 下运行 mod_php,您可以在 .htaccess 中的每个目录中设置它
  3. 。您可以随时通过 ini_set('include_path', $somepath) 在运行时(在您的 php 脚本中)更改它 set_include_path($somepath) (请记住,这会替换之前的值)
  4. 如果您正在运行控制台脚本,则可以通过 <代码>php -d include_path=[WHATEVER PATH]

抱歉,如果这不能帮助您缩小问题范围,但也许它会让您对您实际做了什么产生一些记忆?

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?

寂寞花火° 2024-11-15 04:26:49

您可以覆盖 .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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文