PHP的警告:未知:未能打开流 [英] PHP Warning: Unknown: failed to open stream

查看:1146
本文介绍了PHP的警告:未知:未能打开流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近编辑Apache httpd.conf文件的mod_rewrite的工作。我不知道这个问题起源于或没有,但我从那天得到这个问题。结果
这是我在前台看到,当我运行软件 -


  

服务器错误的网站中遇到
  而检索错误
  的http://本地主机/ prestashop / 。它可能
  为了维护而关闭或配置
  不正确。


有是触发这个没有具体的文件。但是,我看到了一个由4-5 PHP文件通常小程序,运行良好,但有很多的文件(如prestaShop)软件没有。结果
我查了日志,这是我发现的。

  [周三3月16日19时33分39秒2011] [错误] [客户:: 1] PHP的警告:未知:未能打开流:权限被拒绝未知在线0
[周三3月16日19时33分39秒2011] [错误] [客户:: 1] PHP致命错误:未知:失败需要开放'/var/www/html/yomig/index.php'(include_path中=':/ USR /股/梨:在/ usr /共享/ PHP的')在未知在线0
[周三3月16日19时33分39秒2011] [错误] [客户:: 1]文件不存在:/var/www/html/favicon.ico
[周三3月16日19时33分41秒2011] [错误] [客户:: 1] PHP的警告:未知:未能打开流:权限被拒绝未知在线0
[周三3月16日19时33分41秒2011] [错误] [客户:: 1] PHP致命错误:未知:失败需要开放'/var/www/html/yomig/index.php'(include_path中=':/ USR /股/梨:在/ usr /共享/ PHP的')在未知在线0


解决方案

经历了同样的错误,对我来说这是造成的,因为在我的Mac我已经改变了的DocumentRoot我的用户站点。目录

要解决这个问题,我跑的递归命令,以确保Apache服务具有读取权限。

  sudo的搭配chmod -R 755〜/网站

I edited the apache httpd.conf file recently for the mod_rewrite to work. I don't know if this problem originated from that or not, but i'm getting this problem from that day.
This is what I see on the frontend when I run the software -

Server error The website encountered an error while retrieving http://localhost/prestashop/. It may be down for maintenance or configured incorrectly.

There is no specific file that triggers this. But I saw that usually small programs that consists of 4-5 php files, runs fine, but softwares with a lot of files(like PrestaShop) don't.
I checked the logs and this is what I found.

[Wed Mar 16 19:33:39 2011] [error] [client ::1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Wed Mar 16 19:33:39 2011] [error] [client ::1] PHP Fatal error:  Unknown: Failed opening required '/var/www/html/yomig/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0
[Wed Mar 16 19:33:39 2011] [error] [client ::1] File does not exist: /var/www/html/favicon.ico
[Wed Mar 16 19:33:41 2011] [error] [client ::1] PHP Warning:  Unknown: failed to open stream: Permission denied in Unknown on line 0
[Wed Mar 16 19:33:41 2011] [error] [client ::1] PHP Fatal error:  Unknown: Failed opening required '/var/www/html/yomig/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

解决方案

Experienced the same error, for me it was caused because on my Mac I have changed the DocumentRoot to my users Sites directory.

To fix it, I ran the recursive command to ensure that the Apache service has read permissions.

sudo chmod -R 755 ~/Sites

这篇关于PHP的警告:未知:未能打开流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆