我甚至添加了’cipher’=> MCRYPT_RIJNDAEL_256在/app/config/app.PHP中,如http://laravel.com/docs/upgrade#upgrade-4.2所述
已经发生了:http://laravel.io/forum/06-02-2014-not-able-run-artisan-commands
当我将Artisan :: call(‘migrate’)放入try / catch块控制器时,看起来像这样:
public function ArtMigr(){ try { Artisan::call('migrate'); } catch (Exception $e) { echo $e; } }
我收到以下错误:
exception ‘ErrorException’ with message ‘Use of undefined constant
STDIN – assumed ‘STDIN” in
D:\htdocs\artisan_error\vendor\symfony\console\Symfony\Component\Console\Helper\QuestionHelper.PHP:112
Stack trace: #0
D:\htdocs\artisan_error\vendor\symfony\console\Symfony\Component\Console\Helper\QuestionHelper.PHP(112):
Illuminate\Exception\Handler->handleError(8,‘Use of undefine…’,
‘D:\htdocs\artis…’,112,Array) #1
D:\htdocs\artisan_error\vendor\symfony\console\Symfony\Component\Console\Helper\QuestionHelper.PHP(49):
Symfony\Component\Console\Helper\QuestionHelper->doAsk(Object(Symfony\Component\Console\Output\NullOutput),
Object(Symfony\Component\Console\Question\ConfirmationQuestion)) #2
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Console\Command.PHP(186):
Symfony\Component\Console\Helper\QuestionHelper->ask(Object(Symfony\Component\Console\Input\ArrayInput),
Object(Symfony\Component\Console\Output\NullOutput),
Object(Symfony\Component\Console\Question\ConfirmationQuestion)) #3
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Console\ConfirmableTrait.PHP(21):
Illuminate\Console\Command->confirm(‘Do you really w…’) #4
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\MigrateCommand.PHP(59):
Illuminate\Database\Console\Migrations\MigrateCommand->confirmToProceed()5 D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Console\Command.PHP(112):
Illuminate\Database\Console\Migrations\MigrateCommand->fire() #6
D:\htdocs\artisan_error\vendor\symfony\console\Symfony\Component\Console\Command\Command.PHP(252):
Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArrayInput),
Object(Symfony\Component\Console\Output\NullOutput)) #7
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Console\Command.PHP(100):
Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArrayInput),
Object(Symfony\Component\Console\Output\NullOutput)) #8
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Console\Application.PHP(96):
Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArrayInput),
Object(Symfony\Component\Console\Output\NullOutput)) #9 [internal
function]: Illuminate\Console\Application->call(‘migrate’) #10
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Foundation\Artisan.PHP(57):
call_user_func_array(Array,Array) #11
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.PHP(208):
Illuminate\Foundation\Artisan->__call(‘call’,Array) #12
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.PHP(208):
Illuminate\Foundation\Artisan->call(‘migrate’) #13
D:\htdocs\artisan_error\app\controllers\HomeController.PHP(160):
Illuminate\Support\Facades\Facade::__callStatic(‘call’,Array) #14
D:\htdocs\artisan_error\app\controllers\HomeController.PHP(160):
Illuminate\Support\Facades\Artisan::call(‘migrate’) #15
D:\htdocs\artisan_error\app\controllers\HomeController.PHP(145):
HomeController->InstallDatabaseStructure() #16
D:\htdocs\artisan_error\app\controllers\HomeController.PHP(127):
HomeController->WriteDatabaseCredentials(‘localhost’,
‘laravel-aplikac…’,‘root’,”) #17 [internal function]:
HomeController->postTestDatabaseConnection() #18
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\Controller.PHP(231):
call_user_func_array(Array,Array) #19
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.PHP(93):
Illuminate\Routing\Controller->callAction(‘postTestDatabas…’,Array)20 D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.PHP(62):
Illuminate\Routing\ControllerDispatcher->call(Object(HomeController),
Object(Illuminate\Routing\Route),‘postTestDatabas…’) #21
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\Router.PHP(930):
Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route),
Object(Illuminate\Http\Request),‘HomeController’,
‘postTestDatabas…’) #22 [internal function]:
Illuminate\Routing\Router->Illuminate\Routing{closure}() #23
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\Route.PHP(105): call_user_func_array(Object(Closure),Array) #24
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\Router.PHP(996):
Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #25
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Routing\Router.PHP(964):
Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))26 D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Foundation\Application.PHP(738):
Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
27 D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Foundation\Application.PHP(708):
Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
28 D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Session\Middleware.PHP(72):
Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request),
1,true) #29
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Cookie\Queue.PHP(47):
Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request),true) #30
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Cookie\Guard.PHP(51):
Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request),1,
true) #31
D:\htdocs\artisan_error\vendor\stack\builder\src\Stack\StackedHttpKernel.PHP(23):
Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request),
true) #32
D:\htdocs\artisan_error\vendor\laravel\framework\src\Illuminate\Foundation\Application.PHP(606):
Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request)) #33
D:\htdocs\artisan_error\public\index.PHP(49):
Illuminate\Foundation\Application->run() #34 {main}
一切都在我身边做得好吗?
composer.js包含:
{ "name": "laravel/laravel","description": "The Laravel Framework.","keywords": ["framework","laravel"],"license": "MIT","require": { "laravel/framework": "4.2.*","way/generators": "dev-master" },"autoload": { "classmap": [ "app/commands","app/controllers","app/models","app/database/migrations","app/database/seeds","app/tests/TestCase.PHP" ] },"scripts": { "post-install-cmd": [ "PHP artisan clear-compiled","PHP artisan optimize" ],"post-update-cmd": [ "PHP artisan clear-compiled","post-create-project-cmd": [ "PHP artisan key:generate" ] },"config": { "preferred-install": "dist" },"minimum-stability": "stable" }
Artisan::call('migrate',array('--force' => true));
测试和工作正常