2013-10-25 129 views
1

安裝依賴當我產生「PHP composer.phar安裝」我得到以下錯誤的命令:問題由作曲家

{"error":{"type":"PDOException","message":"SQLSTATE[42000] [1044] Access denied for user ''@'localhost' to database 'database'","file":"/var/www/wingtech/wingadmin/public_html/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php","line":47}}Script php artisan optimize handling the post-install-cmd event returned with an error

http://oi42.tinypic.com/20uc2ma.jpg

奇怪的是,當我成立了應用程序數據庫/配置/database.php運行安裝作曲家之前這個錯誤不會出現

爲了緩解我的php版本是5.4.17

我的康波ser.json是:

{ 
"name": "laravel/laravel", 
"description": "The Laravel Framework.", 
"keywords": ["framework", "laravel"], 
"license": "MIT", 
"require": { 
    "laravel/framework": "4.0.*", 
    "orchestra/asset": "2.0.*" 
}, 
"autoload": { 
    "classmap": [ 
     "app/commands", 
     "app/controllers", 
     "app/models", 
     "app/library", 
     "app/database/migrations", 
     "app/database/seeds", 
     "app/tests/TestCase.php" 
    ] 
}, 
"scripts": { 
    "post-install-cmd": [ 
     "php artisan optimize" 
    ], 
    "pre-update-cmd": [ 
     "php artisan clear-compiled" 
    ], 
    "post-update-cmd": [ 
     "php artisan optimize" 
    ], 
    "post-create-project-cmd": [ 
     "php artisan key:generate" 
    ] 
}, 
"config": { 
    "preferred-install": "dist" 
}, 
"minimum-stability": "dev" 
} 

有沒有人知道可能是什麼?

回答

0

類似的行爲在PHP 5.3 <或多個PHP版本上運行,並需要指定在命令行的PHP版本時(工匠優化返回錯誤)發生,即php542 composer.phar安裝 - similar issue here.

但PDO異常很奇怪,你可以檢查composer.json的腳本部分嗎?除了默認的東西還有什麼?

+0

我的php版本是5.4.17,我編輯這個問題與我的composer.json –

1

您可以運行沒有它使用下面的開關運行Laravel腳本作曲:

php composer.phar install --no-scripts 
+2

我想解決這個問題,而不是隻是避免它 –

0

你有一個.ENV文件?這是.env文件丟失時手工腳本的典型錯誤。