【问题标题】:PHP Laravel Homestead - Segmentation fault (core dumped) when error should be thrownPHP Laravel Homestead - 应该抛出错误时出现分段错误(核心转储)
【发布时间】:2019-02-23 12:44:03
【问题描述】:

我在谷歌上搜索了很多关于这个问题并得出一个结论(我不是 100% 确定它是正确的):“分段错误”错误是由 PHP 引起的(不是您项目中的包或什么?)。

当我发现一些东西时,我删除了很多我原来的问题:

php artisan make:migration example

up() 方法的内容:

dump('up()');
$thisShouldThrowAMethodNotExistError = User::whereSomething('nonExisting')->first();
dd('This is the end');

然后,执行迁移的正常方式:

php artisan migrate
"up()"
Segmentation fault (core dumped)

基本上我发现,每当 PHP 抛出错误时(比如在这种情况下,方法 whereSomething 不存在),就会显示 Segmentation fault

我不知道去哪里解决这个问题。当前版本:

  • Laravel/宅基地 - 6.3.0
  • 流浪者 - 2.1.5
  • VirtualBox - 5.2.18

使用php7.1 artisan migrate 运行命令对我来说没有任何改变。

编辑

删除 PHP 7.3.* 和 7.2.* 后,我仍然不会像往常一样收到错误:

vagrant@homestead:~/Code/project$ php -v
PHP 7.1.20-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jul 25 2018 10:07:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.20-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with blackfire v1.22.0~linux-x64-non_zts71, https://blackfire.io, by Blackfire
vagrant@homestead:~/Code/project$ php artisan migrate
 "up()"
Segmentation fault (core dumped)

【问题讨论】:

    标签: php laravel segmentation-fault virtualbox homestead


    【解决方案1】:

    不知何故,它在我们的开发分支发生更改后得到了修复。只是一些与 PHP、配置、Laravel 无关的文件,只是一些小的代码更改。

    我目前的理论是某些文件已损坏或其他什么,当我再次拉出开发分支时解决了。

    如果有人有不同的理论,请告诉我,因为我觉得这一切都很奇怪...... :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-28
      • 1970-01-01
      相关资源
      最近更新 更多