【问题标题】:Laravel update from 5.1.46 to 5.2.* php artisan Segmentation faultLaravel 从 5.1.46 更新到 5.2.* php artisan Segmentation fault
【发布时间】:2026-01-01 11:05:01
【问题描述】:

我正在努力将 Laravel 项目从 5.1.46 更新到 5.2.*。在我按照这里https://laravel.com/docs/5.2/upgrade#upgrade-5.2.0 的步骤操作后,我运行了命令

./composer.phar update

当作曲家尝试运行时,我收到跟随错误

php artisan clear-compiled

分段错误(核心转储)

我尝试手动运行命令

php artisan clear-compiled -vvv

但我的输出完全相同。您知道如何调试导致此问题的原因吗? 这出现在 PHP 5.6 中。 我也尝试过使用 PHP 7.4,但看起来计算机内存不足。出于某种原因,工匠正在占用计算机的整个内存,直到计算机死机。

谢谢!

后期编辑:

我使用了内存限制高达 8G 的 PHP 7.2,我有以下输出:

> php artisan clear-compiled
PHP Fatal error:  Allowed memory size of 8589934592 bytes exhausted (tried to allocate 262144 bytes) in /d/projects/a-car/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 616
PHP Fatal error:  Allowed memory size of 8589934592 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255

【问题讨论】:

  • 你在 Windows 上吗?你的 php 是 32 位还是 64 位的? 32 位版本可能只能使用更少的内存(如果我没记错的话,只有 2GB)。请参阅this QA regarding that magic number 262144 它可能会有所帮助。
  • 是否有任何工匠命令运行?如果不是,可能是this
  • 您是否尝试过删除供应商目录并运行composer install
  • 看起来问题出在已加载但与 Laravel 5.2 不兼容的库上。我已经通过暂时删除该库来解决问题,并且正在为该库进行更新。

标签: php laravel laravel-5 laravel-artisan


【解决方案1】:

看起来问题出在已加载但与 Laravel 5.2 不兼容的库上。我已经通过暂时删除该库来解决问题,并且正在为该库(SleepingOwl)进行更新。

【讨论】: