xampp,php和mysql需要函数错误

时间:2012-10-14 19:11:04

标签: php mysql apache xampp

我正在开发会员系统,但每次运行我的索引页面时都会收到此错误,我甚至不理解它请帮助

  

警告:require(Tutorials \ mysql.php)[function.require]:无法打开流:第3行的C:\ xampp \ htdocs \ xampp \ Tutorials \ index.php中没有此类文件或目录

     

致命错误:require()[function.require]:在C:\ xampp \ htdocs \ xampp中打开所需的'Tutorials \ mysql.php'(include_path ='。; C:\ xampp \ php \ PEAR')失败第3行的Tutorials \ index.php

3 个答案:

答案 0 :(得分:0)

在第3行的文件index.php中,它要求你有一个文件mysql.php但该文件丢失或者在给定的位置上没有找到解释器。

答案 1 :(得分:0)

转到C:\xampp\php\,找到文件php.ini

找到设置include_path并添加目录C:\xampp\htdocs

最后你应该有一些看起来像:

include_path = ".;C:\xampp\php\PEAR;C:\xampp\htdocs或类似的。

不要忘记重新启动XAMPP堆栈!

之后,您的堆栈将在您设置的新路径中查找您尝试包含/要求的文件。

同样在index.php的require行中,请尝试以下操作:

require_once($_SERVER['DOCUMENT_ROOT'] . '/Tutorials/mysql.php');

这将使您明确显示您尝试包含的文件的路径。

答案 2 :(得分:0)

打开index.php并从

更改第3行
require(Tutorials\mysql.php)

require(mysql.php)