當我試圖運行這樣我photoResizer命令的/ var/WWW/myProject的/ proted /的yiic photoResizer
我得到這個錯誤。
PHP Error[8]: Undefined index: SERVER_NAME
in file /var/www/myProject/protected/components/UploadHandler.php at line 190
#0 /var/www/myProject/protected/components/UploadHandler.php(45):
UploadHandler->get_full_url()
#1 /var/www/myProject/protected/commands/PhotoResizerCommand.php(37):
UploadHandler->__construct()
#2 /var/www/myProject/framework/console/CConsoleCommandRunner.php(71):
PhotoResizerCommand->run()
#3 /var/www/myProject/framework/console/CConsoleApplication.php(92):
CConsoleCommandRunner->run()
#4 /var/www/myProject/framework/base/CApplication.php(180):
CConsoleApplication->processRequest()
#5 /var/www/myProject/framework/yiic.php(33): CConsoleApplication->run()
#6 /var/www/myProject/protected/yiic.php(7): require_once()
#7 /var/www/myProject/protected/yiic(4): require_once()
我需要解決這個問題或任何替代方案來通過命令行在yii框架中運行一個PHP腳本。
謝謝。
這是你的類,你得到的錯誤,請嘗試剛剛殺青它。 – MightyPork