其中 PHP“set_include_path”是有效吗?

发布于 2024-09-28 03:27:39 字数 227 浏览 1 评论 0原文

我想将 my_path 添加到 include_path 并相对于 my_path 添加 include 文件。

在我网站的主 PHP 文件中使用 set_include_path 设置 include_path 是否足够,或者我必须在每个 PHP 文件中执行此操作?

I would like to add my_path to include_path and include files relatively to my_path.

Is that enough to set the include_path using set_include_path in the main PHP file of my website, or I must do this in every PHP file ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

倾城泪 2024-10-05 03:27:40

您不必为每个包含的文件重复此操作。另一种方法是使用 .htaccess 文件:

php_value include_path new_path:/old/paths/here

You don't have to repeat it for each included file. An alternative approach would be using .htaccess files:

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