??
Yii中使用gii遇到“unable to write the file”
显然这是因为gii没有权限来写文件,所以如果你按照http://www.yiichina.com/doc/guide/2.0/start-gii 这里和之前的步骤来做的话,你必须先把下面文件先删除:
rm /var/www/html/basic/models/Country.php
rm /var/www/html/basic/controllers/CountryController.php
rm /var/www/html/basic/views/country/index.php
然后给web权限:
chown www-data:www-data /var/www/html/basic/models
chown www-data:www-data /var/www/html/basic/controllers
chown www-data:www-data /var/www/html/basic/views/country
接着就可以访问http://机器名/basic/web/index.php?r=gii 来生成model和CRUD,弄完之后访问页面http://机器名/basic/web/index.php?r=country/index,一切正常运行之后,最好把权限改回来:
chown root:root /var/www/html/basic/models
chown root:root /var/www/html/basic/controllers
chown root:root /var/www/html/basic/views/country
以上就介绍了Yii中使用gii遇到“unable to write the file”,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号