Home > Backend Development > PHP Tutorial > failed to open stream: No such file or directory Problem Collection_PHP Tutorial

failed to open stream: No such file or directory Problem Collection_PHP Tutorial

WBOY
Release: 2016-07-21 14:58:04
Original
3258 people have browsed it

failed to open stream: No such file or directory. This article is collected and organized by the editor of Bangkejia. Please keep the source when reprinting.

Case 1:

(failed to open stream: No such file or directory) The directory permissions configured in the PHP environment under IIS cause errors

Causes and solutions:

Configure the environment as IIS + php

If you confirm that your program can run normally in other environments but an error similar to the following occurs only in IIS under Win:

Warning: main(./Config.php): failed to open stream: No such file or directory in D:wwwrootDemoConfig.php on line 13

Fatal error: main(): Failed opening required './Config.php' (include_path='.;c:php4pear') in D:wwwrootCoreConfig.php on line 13

This problem is mainly caused by the removal of everyone permissions on the Win NTFS disk. It can be solved by adding an Internet guest account to the security permissions.

Operation steps: D drive -> Properties -> Security -> Add user IUSR_XXXXX OK

Case 2:

The problem is:
Warning: require_once(../lib/DBUtil.class.php) [function.require-once]: failed to open stream: No such file or directory in E:phpprodxhserviceExpertService.class.php on line 2

Fatal error: require_once() [function.require]: Failed opening required '../lib/DBUtil.class.php' (include_path='.;C:php5pear') in E: phpprodxhserviceExpertService.class.php on line 2

Solution:

1. Add dirname(__FILE__) when require, like this: require_once(dirname(__FILE__)."/../lib/DBUtil.class.php");

2. Understand the require_once instance as follows:

Copy to ClipboardLiehuo.Net CodesQuoted content: [www.bkjia.com] //If b.php is referenced by a.php file require or include in other directories
require_once("./c.php"); //Actually, a is called c.php in the .php directory
require_once(dirname(__FILE__)."/c.php"); //What is actually called is c.php in the b.php directory
require_once("c. php"); //What is actually called is c.php in the b.php directory
?>

Case 3:

When running the php website, an error occurred. The content is as follows:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required 'E:/php/www/mrsoft/Register Login Module/index.php' (include_path='.;C:php5pear') in Unknown on line 0

File structure:

Solution:

apache cannot parse the Chinese URL of the "Registration Login Module" in the picture above, just change it to the English path.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/363896.htmlTechArticlefailed to open stream: No such file or directory A complete list of problems, this article is collected and compiled by the editor of Liehuo.com, please download it at Keep the source when reprinting. Case 1: (failed to open stream: No such f...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template