require_once()无法找到包含路径 [英] require_once() cant find the include path

查看:142
本文介绍了require_once()无法找到包含路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我试图通过使用require_once到indlude一个文件()。我使用的Apache XAMPP PHP服务器。
该文件test.php的是在Drupal的htdocs目录文件夹也是在同一个目录中包含文件中。
在第5行,code是

Hi i am trying to indlude a file by using require_once(). i am using xampp apache php server. the file test.php is in htdocs drupal folder is also in the same directory where the include files is. the code in line 5 is

require_once'drupal7 /包括/ bootstrap.inc文件';

require_once ‘drupal7/includes/bootstrap.inc’;

我得到误差

警告:通过司用C零:\\ XAMPP \\ htdocs中\\ import.php第5行

Warning: Division by zero in C:\xampp\htdocs\import.php on line 5

警告:require_once(INC)一次function.require]:未能打开流:C中没有这样的文件或目录:\\ XAMPP \\ htdocs中\\ import.php第5行

Warning: require_once(inc’) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\import.php on line 5

致命错误:require_once()[function.require]:无法打开需要'INC''(include_path中=; C:\\ XAMPP \\ PHP \\ PEAR')在C:\\ XAMPP \\ htdocs中\\ import.php上第5行

Fatal error: require_once() [function.require]: Failed opening required 'inc’' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\import.php on line 5

有人请指导我如何将本地文件。

someone please guide me how to include a local file.

推荐答案

看起来你在第5行神奇的单引号(你从什么地方复制呢?)他们更改为普通单引号,像这样的:

Looks like you have "fancy" single quotes in line 5. (Did you copy this from somewhere?) Change them to regular single quotes, like these:

require_once 'drupal7/includes/bootstrap.inc';

这篇关于require_once()无法找到包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆