php include语句无法打开当前目录上方目录中的文件流
我试图使用相对文件路径将文件包含在不同的目录中,但是我不断收到错误:
failed to open stream: No such file or directory
调用包含语句的文件的路径是
wp-content/plugins/php-code-widget/execphp.php
,我尝试包含的文件是
wp-content/uploads/espresso/templates/sidebar_widgets/register_widget.php
这是我的包含语句:
<?php include ('../../uploads/espresso/templates/sidebar_widgets/register_widget.php ?>
任何人看到问题了吗?
I am trying to include a file in a different directory using a relative file path however I keep getting the error:
failed to open stream: No such file or directory
The path of the file calling the include statement is
wp-content/plugins/php-code-widget/execphp.php
and the file I'm trying to include is
wp-content/uploads/espresso/templates/sidebar_widgets/register_widget.php
This is my include statement:
<?php include ('../../uploads/espresso/templates/sidebar_widgets/register_widget.php ?>
Anyone see the problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会避免相对路径。
只要 WordPress 自从我上次使用以来没有发生太大变化,就可以尝试诸如...
I would avoid the relative path.
So long as WordPress hasn't changed too much since I last used it, try something like...