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

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

问题描述

我最近编辑了 apache httpd.conf 文件,以便 mod_rewrite 工作.我不知道这个问题是否源于那个,但我从那天开始遇到这个问题.
这是我运行软件时在前端看到的 -

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 -

服务器错误 网站遇到检索时出错http://localhost/prestashop/.它可能停机维护或配置不正确.

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

没有触发此的特定文件.但我看到通常由 4-5 个 php 文件组成的小程序运行良好,但包含大量文件的软件(如 PrestaShop)则不行.
我检查了日志,这就是我发现的.

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

推荐答案

遇到同样的错误,对我来说是因为在我的 Mac 上我将 DocumentRoot 更改为我的用户站点目录.

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

为了修复它,我运行了递归命令以确保 Apache 服务具有读取权限.

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天全站免登陆