use*_*337 16 php laravel composer-php laravel-4
我最近尝试从Laravel 4.0升级到Laravel 4.1,运行php composer.phar update时出现以下错误:
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
Run Code Online (Sandbox Code Playgroud)
我只要求:
"require": {
"laravel/framework": "4.1.*",
"way/generators": "2.*",
"madewithlove/laravel-oauth2": "0.4.*"
},
Run Code Online (Sandbox Code Playgroud)
另外,我在错误之前收到了这个(即使我在我的环境中运行php 5.4.10):
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
phpseclib/phpseclib suggests installing pear-pear/PHP_Compat (Install PHP_Compat to get phpseclib working on PHP < 4.3.3.)
d11wtq/boris suggests installing ext-readline (*)
d11wtq/boris suggests installing ext-pcntl (*)
Writing lock file
Generating autoload files
Run Code Online (Sandbox Code Playgroud)
编辑:
在composer.json中使用的脚本:
"scripts": {
"pre-install-cmd": [
"php artisan clear-compiled"
],
"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"
]
},
Run Code Online (Sandbox Code Playgroud)
小智 8
也许你可以尝试这个命令:
composer install --no-scripts
Run Code Online (Sandbox Code Playgroud)
在composer.json中尝试以下操作.有明确的编译处理的预更新CMD事件是你的错误,你可能会清除它.
"scripts": {
"pre-install-cmd": [
"php artisan clear-compiled"
],
"post-install-cmd": [
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
Run Code Online (Sandbox Code Playgroud)
尝试再次运行以下命令:
php composer.phar update
Run Code Online (Sandbox Code Playgroud)
小智 5
为我工作:
根据升级指南更新composer.json后,获取所有更新的存储库:
composer update --no-scripts
然后:composer dump-autoload -o
然后,我再次运行更新,以便我的更新前/更新后脚本可以运行:composer update
应用程序在浏览器中加载,并且我使用 5.2 再次通过了所有测试。希望这可以帮助。