Heim  >  Artikel  >  Backend-Entwicklung  >  Yii中使用gii遇到“unable to write the file”

Yii中使用gii遇到“unable to write the file”

WBOY
WBOYOriginal
2016-07-29 08:56:121659Durchsuche

??

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教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn