In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the solution of require_once error report in php, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
Php require_once error because the function will put all the code in the CategoryDao.class.php file into the login.php, the solution is: 1, the use of "require_once (" relative path ")"; 2, the path of the file that calls the require_once function.
Operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer
What if php require_once reports an error? the correct path cannot be found in php require_once ().
First of all, to describe the problem, when I use the require_once () function, I think that the path configuration is fine, but the web page will still have an error that the path can not be found. The details are as follows:
My project path is as follows:
In the login.php file, I called require_once (". / mysql/CategoryDAO.class.php"); to include the CategoryDao.class.php file, and then called require_once (". / DbConnect.class.php") in the CategoryDao.class.php file; to include the DbConnect.class.php file, and as a result, the browser could not find the target file.
This is because the require_once () function in login.php will put all the code in the CategoryDao.class.php file into the login.php, that is, the login.php file contains all the code in the CategoryDao.class.php file, including require_once (". / DbConnect.class.php"); however, the current directory is the path of login.php, so the path ". / DbConnect.class.php" can not be found, the correct path should be ". / mysql/DBConnect.class.php".
To sum up, when using require_once (relative path), the current path is the path of the last file that called the require_once function.
Thank you for reading this article carefully. I hope the article "the solution to require_once error reporting in php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.