yii2服务器无法加载文件,yii2查看服务器500错误的方法

b76178a2718fdbf8ed87aebf7d0af06a.png

服务器500错误:

首先开启 web/index.php defined('YII_DEBUG') or define('YII_DEBUG', true); 将此改 true;看下报错的问题Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory is not writable by the Web process: /home/wwwroot/1XX.2X.XX3.X2/xhedu/backend/web/assets'in /home/wwwroot/12X.2X.XXX.1X/xhedu/vendor/yiisoft/yii2/web/AssetManager.php:213

assests 文件夹及其文件权限不足,导致无法访问 AssetManager.php 将其改为777 我之前的项目的 所有者和组的名称是 www 权限是最大的777 后来的项目的用户名是 root 权限不是最大 所有需要将项目assests文件夹 改为777 就可以了。

PHP中文网,有大量免费的Yii入门教程,欢迎大家学习!