Home  >  Article  >  Backend Development  >  php include prompt failed to open stream: Permission denied in error_PHP Tutorial

php include prompt failed to open stream: Permission denied in error_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:17:392156browse

php include prompts failed to open stream: Permission denied in error

The occurrence of failed to open stream: Permission denied in means that the apache running user does not have permission to access the specified file. As a result, the directory file cannot be opened.

Prompt when opening the browser

 Warning: include (/global.php) [function.include]: failed to open stream: Permission denied in index.php on line 21

 Warning: include() [function.include]: Failed opening '/global.php' for inclusion (include_path='.;C:php5pear') in index.php on line 21

Fatal error: Class 'fl_global' not found in index.php on line 22

From so many error messages, we can see that failed to open stream: Permission denied in means that there is no permission to access this problem

Linux solution

Under linux

chmod -R 777 ./dirname gives the directory writable permissions

Chmod 777 ./filename gives the file writable permissions.

Windows 2003 solution

I am an apache user, so I only need to give the apache user permissions (if you are an iis user, you also need to set permissions in iis)

Example: Right-click the www or web directory, then click "Security and Sharing" or "Properties" in the pop-up window. You can also open it and select security, then add users and set access permissions for users. You must select as shown in the figure below. Okay, please note that the access user we add must be the same as the apache directory.

php include提示failed to open stream: Permission denied in错误 帮客之家

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/890392.htmlTechArticlephp include prompt failed to open stream: Permission denied in error failed to open stream: Permission denied in is running apache The user does not have permission to access the specified file, so...
Statement:
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