Maison  >  Article  >  développement back-end  >  Yii中使用gii遇到“unable to write the file”

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

WBOY
WBOYoriginal
2016-07-29 08:56:121656parcourir

??

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

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn