Php 致命错误和警告?
我正在尝试使用PHP和MySQL创建一个登录系统,但没有显示要显示的消息:Php 致命错误和警告?,php,mysql,Php,Mysql,我正在尝试使用PHP和MySQL创建一个登录系统,但没有显示要显示的消息:Array([0]=>MySQL[1]=>host)出现以下消息: Warning: require_once(0): failed to open stream: No such file or directory in C:\xampp\htdocs\myfiles\core\init.php on line 21 Fatal error: require_once(): Failed opening require
Array([0]=>MySQL[1]=>host)
出现以下消息:
Warning: require_once(0): failed to open stream: No such file or directory in C:\xampp\htdocs\myfiles\core\init.php on line 21
Fatal error: require_once(): Failed opening required '0' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\myfiles\core\init.php on line 21
有人知道为什么会这样,我能做些什么来阻止它吗
这也是init.php的第21行:
require_once'classes/'+$class+'.php'字符串连接是通过
操作符完成的。您包含的路径为:
require_once 'classes/' . $class . '.php';
你应该考虑为你的班级使用AN。此机制的标准化还有待改进。require\u once需要一个表示文件路径的字符串,您正在传递它0,它不是文件路径。require\u once()中尝试包含的文件不存在。
。您可能有错误的路径。请使用
而不是+
来连接路径字符串。谢谢,但现在出现了:致命错误:在C:\xampp\htdocs\myfiles\index.php的第4行中找不到类“Config”;/“这是index.php:echo-Config::get('mysql/host')中的第4行。”127.0.0.1'