简体   繁体   English

致命错误php XAMPP

[英]Fatal error php XAMPP

I am trying to get make my setup for using Laravel and I am getting this error when I am trying to access MySQL from XAMPP Control Panel. 我试图进行使用Laravel的设置,并且尝试从XAMPP控制面板访问MySQL时遇到此错误。

Warning: require_once(libraries/common.inc.php): failed to open stream: No such file or directory in C:\xampp\phpMyAdmin\index.php on line 20

Fatal error: require_once(): Failed opening required 'libraries/common.inc.php' (include_path='C:\wamp\php\PEAR') in C:\xampp\phpMyAdmin\index.php on line 20

I have found somequestions that had a similar problem, but cannot figure out how to solve this problem, because I haven`t found a detailed answear that could solve my error. 我发现了一些有类似问题的问题,但无法解决该问题,因为我没有找到可以解决我的错误的详细答案。

Simply use syntax require_once('libraries\\common.inc.php') without dash will be considered as a error because according to function it accept path which is string only not other. 只需使用语法require_once('libraries\\common.inc.php')而不使用破折号将被视为错误,因为根据功能它接受仅字符串而不是其他路径。 here without dash in your line will not be interpreted by PHP due to it neither taken as variable nor Path, hence results FATAL only.. 这里的行中没有破折号,PHP既不会将其解释为变量也不会将其解释为Path,因此仅会致命。

The script index.php located in C:\\xampp\\phpMyAdmin\\ is trying to load file on relative path libraries/common.inc.php , ie on location C:\\xampp\\phpMyAdmin\\libraries . 位于C:\\xampp\\phpMyAdmin\\的脚本index.php试图在相对路径libraries/common.inc.php ,即在位置C:\\xampp\\phpMyAdmin\\libraries上加载文件。

The require_once has the feature that when the file is not found, then the PHP is interrupted with PHP Fatal error , more on PHP Manual: require_once require_once具有以下特性:找不到文件时,PHP会因PHP Fatal error中断而中断,有关更多信息,请参见PHP手册:require_once

Make sure the subdirectory libraries is available and readable for the webserver/apache and the file common.inc.php exists. 确保子目录libraries对于Web服务器/ apache可用并且可读,并且文件common.inc.php存在。

Note: it is always better to put strings into quotation marks ' or " . Note: make sure to use correct directories separator \\ or / based on your operating system. 注意:始终最好将字符串放在引号'" 。注意:确保根据操作系统使用正确的目录分隔符\\/

Here I guess correct would be require_once('libraries\\common.inc.php') 在这里我想正确的是require_once('libraries\\common.inc.php')

You need to logout from phpMyAdmin. 您需要从phpMyAdmin注销。 Because this issue is related to your session. 因为此问题与您的会话有关。

Once the session is empty empty then it will work fine. 一旦会话为空,则它将正常工作。 Same thing happens to me and it resolved after logout. 我发生了同样的事情,注销后解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM