gpt4 book ai didi

php - 我的 Composer 不会用 Laravel 4 完全更新它被 artisan 卡住了

转载 作者:IT王子 更新时间:2023-10-29 00:20:37 24 4
gpt4 key购买 nike

这是我遇到的错误:

Script php artisan optimize handling the post-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]

这显示在:

Writing lock file
Generating autoload files

我试图删除供应商文件夹中的所有文件夹。但这并没有改变任何东西。

我在我的 Mac OS X 上使用 MAMP 服务器。

PHP 版本 5.4.10

加密 2.5.8

我刚刚尝试了“sudo composer update --verbose”,但出现了这个错误:

sudo composer update --verbose
Password:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
Script php artisan optimize handling the post-update-cmd event returned with an error

[RuntimeException]
Error Output:
Exception trace:
() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:148
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:107
Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() at phar:///usr/bin/composer/src/Composer/Installer.php:289
Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/UpdateCommand.php:118
Composer\Command\UpdateCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:897
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:191
Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:117
Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:121
Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:83
Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:43
require() at /usr/bin/composer:15

这是我在 PHP 错误日志中发现的错误:

[04-Nov-2013 20:45:44 Europe/Berlin] PHP Fatal error:  Class 'Patchwork\Utf8\Bootup' not found in /Applications/MAMP/htdocs/-----/bootstrap/autoload.php on line 46

我只是想测试我的 Composer :

sudo composer diagnose
Password:
Checking platform settings: OK
Checking http connectivity: OK
Checking composer.json: FAIL
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Name "andrew13/Laravel-4-Bootstrap-Starter-Site" does not match the best practice (e.g. lower-cased/with-dashes). We suggest using "andrew13/laravel-4-bootstrap-starter-site" instead. As such you will not be able to submit it to Packagist.
Checking disk free space: OK
Checking composer version: OK

刚刚应用了上一条命令的错误消息中的建议。现在一切都显示正常。

我刚试过这个:

curl -sS https://getcomposer.org/installer | php -- --check
#!/usr/bin/env php
All settings correct for using Composer

我现在在我的 PHP 错误日志中收到新错误:

[05-Nov-2013 05:45:45 Europe/Berlin] PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Class config does not exist' in /Applications/MAMP/htdocs/---/bootstrap/compiled.php:165
Stack trace:
#0 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(165): ReflectionClass->__construct('config')
#1 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(142): Illuminate\Container\Container->build('config', Array)
#2 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(444): Illuminate\Container\Container->make('config', Array)
#3 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(233): Illuminate\Foundation\Application->make('config')
#4 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(3151): Illuminate\Container\Container->offsetGet('config')
#5 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(103): Illuminate\Exception\ExceptionServiceProvider->Illuminate\Exception\{closure}(Object(Illuminate\Foundation\Application))
#6 /Applications/MAMP/htdocs/---/bootstrap/compiled.php(163): Illuminate\Container\Container->Illum in /Applications/MAMP/htdocs/---/bootstrap/compiled.php on line 165

最佳答案

我认为此错误是由于无法找到 mcrypt 而导致的。

Script php artisan optimize handling the post-update-cmd event returned with an error

显然安装mcrypt并不是那么容易。

  1. 安装 php5-mcrypt 包,或验证它是否已正确安装。

    sudo apt-get install php5-mcrypt
  2. 检查 mcrypt 是否已经安装并为 PHP 启用:

    php --ri mcrypt
  3. 如果它显示:

    mcrypt support => enabled

    否则,如果它说:

    Extension 'mcrypt' not present.
  4. 验证 mcrypt.ini 是否存在于 PHP 的 mods-available 目录中。

    ls /etc/php5/mods-available/mcrypt.ini
  5. 如果显示没有这样的文件或目录,创建一个从mcrypt.ini 到PHP 的mods-available 目录的符号链接(symbolic link).

    sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
  6. 启用模组。

    sudo php5enmod mcrypt
  7. 重新启动 Apache。

    sudo service apache2 restart
  8. 再次检查是否启用了mcrypt

    php --ri mcrypt

最后的步骤受到 Vuk Stanković 的启发.

关于php - 我的 Composer 不会用 Laravel 4 完全更新它被 artisan 卡住了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19775012/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com