Fatal error php XAMPP

与世无争的帅哥 提交于 2019-12-13 03:41:54

问题


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.

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.


回答1:


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.

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

Make sure the subdirectory libraries is available and readable for the webserver/apache and the file common.inc.php exists.

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')




回答2:


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. 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..




回答3:


You need to logout from 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.



来源:https://stackoverflow.com/questions/47779515/fatal-error-php-xampp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!