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

Source: Internet
Author: User

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

The following error occurs: failed to open stream: Permission denied in indicates that the apache running user has no Permission to access the specified file, so 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 declaration (include_path = '.; c: \ php5 \ pear ') in index. php on line 21

Fatal error: Class 'fl _ global' not found in \ index. php on line 22

From so many error prompts, we can see a failed to open stream: Permission denied in, which means there is no Permission to access this problem.

Linux Solution

Linux

Chmod-R 777./dirname grant the directory write permission

Chmod 777./filename grant the file write permission.

Windows 2003 solution

I am an apache user, so I only need to grant apache user permissions (if I am an iis user, I still need to set permissions in iis)

Example: Right-click the www or web directory, and then click "security and sharing" or "attribute" in the pop-up window to enable security and other options, then add the user and set the permission to access the user, which must be selected. Note that the added user must be the same as the apache directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.