2013年10月17日 星期四

yii framework - shell指令時出現Error: index.php does not exist or is not an entry script file.

你會在你的專案底下的protected資料夾發現有個yiic.bat, 但是如果你在windows的命令提示字元輸入

>cd c:\xampp\htdocs\你的專案名稱\protected

接著輸入

>yiic shell

就會出現這句錯誤

>Error: index.php does not exist or is not an entry script file.

解決方法是要輸入

>yiic shell ../index.php



就會看到

C:\xampp\htdocs\你的專案名稱\protected>yiic shell ../index.php
Yii Interactive Tool v1.1 (based on Yii v1.1.14)
Please type 'help' for help. Type 'exit' to quit.

輸入help就會看到一大篇說明 (看到表示你已經順利進到shell裡了, 準備享受用指令飛快地替你建立你所需的controller跟action吧 <- 用到的頻率比較高)

C:\xampp\htdocs\你的專案名稱\protected>yiic shell ../index.php
Yii Interactive Tool v1.1 (based on Yii v1.1.14)
Please type 'help' for help. Type 'exit' to quit.
>> help
At the prompt, you may enter a PHP statement or one of the following commands:
 - controller
 - crud
 - form
 - help
 - model
 - module

Type 'help <command-name>' for details about a command.

To expand the above command list, place your command class files
under 'protected/commands/shell', or a directory specified
by the 'YIIC_SHELL_COMMAND_PATH' environment variable. The command class
must extend from CConsoleCommand.

趕快來嘗試輸入

>controller fuck you

看看會發生什麼事吧! ^^

沒有留言:

張貼留言