我是一個noob並在AWS上運行Yii教程。到目前爲止,我已經能夠啓動和運行所有的東西 - 包括mysql連接。但是現在我正在使用Gii代碼生成工具來幫助創建一些模型類。在此過程中,我發現了以下錯誤:Yii/Linux上的Web進程權限
generating models/User.php
Unable to write the file '/var/www/html/blog/protected/models/User.php'.
done!
的文檔還告訴我:
Info: Because the code generator needs to save the generated code into files, it is
required that the Web process have the permission to create and modify the corresponding
files. For simplicity, we may give the Web process the write permission to the whole
/www/blog directory. Note that this is only needed on development machines when using Gii.
這對我來說很有意義,我理解的Linux權限的基本邏輯應用到用戶和組......但不包括進程。有人能指點我如何給Gii進程寫入webroot權限(在我的情況下:/ var/www/html/blog /)目錄嗎?
後執行想補充一點,我已閱讀並理解在生產服務器上運行Gii的危險。但是,config/main.php文件中的ip過濾器設置被設置爲只允許從我的公共IP地址運行Gii。因此,運行一個實時的AWS實例(而不是WAMP本地主機)似乎仍然是安全的。 – 2012-07-14 07:22:03
進一步更新:我犯了一個錯誤,試圖快速修復,但沒有正確理解它,並做了... chmod -R 0644/var/www/html/blog/...我現在無法訪問頁面,這意味着我已經關閉應用程序。 ... 幫幫我!! – 2012-07-14 07:37:26
套'755'。 '進程'不需要權限,腳本在這種情況下是'Gii'。但是,如果apache在文件夾上有讀/寫/執行權限(7),它應該可以工作,並允許你在'Gii'配置文件中添加你的IP。 – adamors 2012-07-14 11:37:50