Web进程无法写入该目录:/var/www/html/mywebsite/frontend/Web/assets



我正在尝试初始化Yii2应用程序,在我运行命令phpinit和yii生成的所有文件后,我试图从n=我的浏览器中查看,但不断出现错误,我在谷歌和stackflow上搜索了可能的解决方案,但没有成功,到目前为止,我运行了命令chmod 0777 web/assets,也执行了ps -ef | grep apache | grep -v grep,我得到了下面的

apache     4074   4073  0 20:38 ?        00:00:01 /usr/sbin/httpd -DFOREGROUND
apache     4075   4073  0 20:38 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     4076   4073  0 20:38 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     4077   4073  0 20:38 ?        00:00:01 /usr/sbin/httpd -DFOREGROUND
apache     4078   4073  0 20:38 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND
apache     4083   4073  0 20:38 ?        00:00:00 /usr/sbin/httpd -DFOREGROUND

我继续做sudo chgrp apache ./assetssudo chmod g+w ./assets/,但都不起作用,我想这是一种服务器问题,感谢

也许目录所有者与您的php用户有冲突

运行此命令以获取您的apache用户:

ps -ef | grep apache | grep -v grep

然后您可以看到{apache_user},在前端/web目录中运行以下命令:

sudo chgrp {apache_user} ./assets
sudo chmod g+w ./assets/

但如果它不起作用,请告诉我你的操作系统信息

相关内容

最新更新