首頁  >  文章  >  後端開發  >  Yii使用gii遇到“unable to write the file”

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

WBOY
WBOY原創
2016-07-29 08:56:121656瀏覽

??

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/models/Country.php

rm /var/www/html/basic/controllers/CountryController.phprm /var/www/html/basic/views/country/index.php然後給予web www-data:www-data /var/www/html/basic/models

chown www-data:www-data /var/www/html/basic/controllers

chown www-data:www-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教程有興趣的朋友有所幫助。 🎜 🎜 🎜
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn