在PHP8FPM上发生的非常奇怪的事情(使用任何有说服力的触发器)并且无法调试核心程序(PHP7.3是可以的)。
环境是Debian 10 (Vagrant和DO液滴)
PHP 8.0.3
PHP 8.0.5
作曲家展示和刚刚做了一个作曲家的全球更新
...
"require": {
"php": "^7.3|^8.0",
"aws/aws-sdk-php": "^3.176",
"barryvdh/laravel-cors": "^2.0",
"barryvdh/laravel-debugbar": "^3.5",
"barryvdh/laravel-ide-helper": "^2.9",
"barryvdh/laravel-snappy": "^0.4.8",
"beyondcode/laravel-dump-server": "^1.7",
"dyrynda/laravel-nullable-fields": "^4.1",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"google/apiclient": "^2.",
"guzzlehttp/guzzle": "^7.3",
"hashids/hashids": "^4.1",
"laracasts/flash": "^3.2",
"laravel/cashier": "^12.10",
"laravel/framework": "^8.40",
"laravel/horizon": "^5.7",
"laravel/sanctum": "^2.9",
"laravel/scout": "^8.6",
"laravel/socialite": "^5.2",
"laravel/telescope": "^4.4",
"laravel/tinker": "^2.6",
"laravel/ui": "^3.2",
"laravelcollective/html": "^6.2",
"league/csv": "^9.7",
"league/flysystem-aws-s3-v3": "^1.0",
"phery/phery": "^2.7",
"php-parallel-lint/php-console-color": "^1.0",
"plivo/plivo-php": "^4.18",
"predis/predis": "^1.1",
"sofa/eloquence": "dev-master",
"vinkla/hashids": "^9.1",
"wildbit/postmark-php": "^4.0",
"wildbit/swiftmailer-postmark": "^3.3"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
Nginx + php7.4-fpm
Laravel (PHP)代码工作在php7.4-fpm ( nginx +fpm的正常设置)中,如果有语法错误,浏览器会显示一个包含错误的漂亮网页(并链接到望远镜)。
Nginx + php8.0-fpm
大多数“简单”的PHP页面都能工作(快速的phpinfo.php也能正常工作)。但是,当您单击https://laravel.com/docs/8.x/starter-kits#laravel-breeze登录页面上的submit (它显示初始表单)时,它开始显示"502坏网关“(nginx)。
这只发生在php8.0-fpm上(使用Vagrant,也可以在DO液滴上复制)
有东西导致了SIGSEGV的相8.0-FPM(信号11).它甚至没有从php8.0-fpm的响应中命中laravel日志和nginx显示"502坏网关“(标准nginx错误页面)。
论/var/log/php8.0-fpm.log
WARNING: [pool www] child 3956 exited on signal 11 (SIGSEGV - core dumped) after 63.502325 seconds from start
我已经能够生成核心转储,但是bt
并没有显示多少信息。核心转储(在流浪者VM上)超过200 on(用于页面刷新的巨大文件?)它从#0到#38286 (很多行),和我所期望看到的(函数或帧)几乎相同的东西(函数或框架),似乎处于一个无限循环中.
Reading symbols from /usr/sbin/php-fpm8.0...(no debugging symbols found)...done.
[New LWP 3956]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php-fpm: pool www '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000056483469fa4e in zend_is_callable_at_frame ()
(gdb) bt
#0 0x000056483469fa4e in zend_is_callable_at_frame ()
#1 0x00005648346a09a7 in zend_is_callable_ex ()
#2 0x00005648346a0adc in zend_fcall_info_init ()
#3 0x00005648345ca7ec in ?? ()
#4 0x0000564834701268 in execute_ex ()
#5 0x000056483468c5d2 in zend_call_function ()
#6 0x00005648345ca820 in ?? ()
#7 0x0000564834701268 in execute_ex ()
#8 0x000056483468c5d2 in zend_call_function ()
#9 0x00005648345ca820 in ?? ()
#10 0x0000564834701268 in execute_ex ()
#11 0x000056483468c5d2 in zend_call_function ()
#12 0x00005648345ca820 in ?? ()
...
#38280 0x00005648345ca820 in ?? ()
#38281 0x0000564834701268 in execute_ex ()
#38282 0x0000564834702c3c in zend_execute ()
#38283 0x0000564834699e0d in zend_execute_scripts ()
#38284 0x0000564834636b0b in php_execute_script ()
#38285 0x00005648344f0109 in ?? ()
#38286 0x00007f7c0e98109b in __libc_start_main (main=0x5648344ef280, argc=4, argv=0x7ffd1785e398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd1785e388) at ../csu/libc-start.c:308
#38287 0x00005648344f0f1a in _start ()
在代码方面,我已经能够将它隔离开来,也许很有说服力,但是数据库正在工作。
以下几行起作用
$users = DB::table('users')->get();
//dd($users);
echo count($users); // show 31
但是,添加以下内容将得到SIGSEGV
$user = User::find(10001);
或
$users = User::all(); // only 31 records in the database
有什么想法吗?也许降级到php7.4(这似乎不是一个好方法)
也许这就是php 8处理错误和异常的方式吗?
发布于 2021-10-15 19:21:31
我也有同样的问题。在我的例子中,我的一个编写器包不兼容php8 (雄辩)。要找到使用了大量内存的失败包,我必须一个一个地composer remove
每个包,测试它,重新启用它,并执行下一个包,直到它工作.我知道这是一个痛苦的做法,但这是唯一的方法,我知道如何发现。
https://stackoverflow.com/questions/67423576
复制相似问题