gpt4 book ai didi

Php 错误 : failed to open stream: Permission denied in CentOS 7. 1.1503(核心)

转载 作者:太空宇宙 更新时间:2023-11-04 09:29:33 25 4
gpt4 key购买 nike

我正在运行 Apache/2.4.6 (CentOS) build Aug 24 2015 18:11:25 on CentOS Linux release 7.1.1503 (Core) 64-bit。我在“w”模式和“a”模式下打开文件时遇到问题。我搜索了很多。尝试了所有提到的步骤,但我仍然没有得到想要的结果。同一个文件可以工作,并允许我在 Windows 10 中以“w”模式和“a”模式打开。但它在 CentOS 中不起作用。在目录“/var/www/html/editable”中有一个名为“home.php”的文件。当我尝试以“w”模式或“a”模式从文件 srvr_file_access.php 打开该文件时,出现以下错误:

PHP Warning: fopen(/var/www/html/editable/home.php): failed to open stream: Permission denied in /var/www/html/srvr_file_access.php

我已将该文件和目录的所有者和组更改为“apache”并分配了权限 755。 'home.php'文件和目录的权限如下:

home.php

-rwxr-xr-x+ 1 apache apache 0 Oct 11 14:41 home.php

/var/www/html/editable

drwxr-xr-x+ 2 apache apache   21 Oct 11 14:56 editable

谁能帮我解决这个问题?

谢谢。

最佳答案

对于仍然有此问题的任何人,我通过在/var 中创建文件夹然后使用 chown apache:apache folder_name,然后移动到 www 文件夹来解决它。

关于Php 错误 : failed to open stream: Permission denied in CentOS 7. 1.1503(核心),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33065183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com