【发布时间】: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