我将我的一台 Ubuntu 16.04.5 LTS 服务器从 PHP 5.6 升级到 7.2。我使用 Ondrej PPA:https://launchpad.net/~ondrej/+archive/ubuntu/php
升级后,我发现生产流量存在一些分段错误......
我尝试将 gdb 与 coredump 结合使用,但不太理解它:
#0 0x00007ff113f35542 in zend_update_class_constants () from /usr/lib/apache2/modules/libphp7.2.so
#1 0x00007ff113f35563 in zend_update_class_constants () from /usr/lib/apache2/modules/libphp7.2.so
#2 0x00007ff113f35cc1 in _object_and_properties_init () from /usr/lib/apache2/modules/libphp7.2.so
#3 0x00007ff113fd4e1c in ?? () from /usr/lib/apache2/modules/libphp7.2.so
#4 0x00007ff113fde90b in execute_ex () from /usr/lib/apache2/modules/libphp7.2.so
#5 0x00007ff113fe4d1e in zend_execute () from /usr/lib/apache2/modules/libphp7.2.so
#6 0x00007ff113f331e3 in zend_execute_scripts () from /usr/lib/apache2/modules/libphp7.2.so
#7 0x00007ff113ece330 in php_execute_script () from /usr/lib/apache2/modules/libphp7.2.so
#8 0x00007ff113fe6ed2 in ?? () from /usr/lib/apache2/modules/libphp7.2.so
#9 0x00005562052ef140 in ap_run_handler ()
#10 0x00005562052ef6c6 in ap_invoke_handler ()
#11 0x0000556205305e2c in ap_internal_redirect ()
#12 0x00007ff10fdfaa92 in ?? () from /usr/lib/apache2/modules/mod_rewrite.so
#13 0x00005562052ef140 in ap_run_handler ()
#14 0x00005562052ef6c6 in ap_invoke_handler ()
#15 0x0000556205305e2c in ap_internal_redirect ()
#16 0x00007ff10fdfaa92 in ?? () from /usr/lib/apache2/modules/mod_rewrite.so
#17 0x00005562052ef140 in ap_run_handler ()
#18 0x00005562052ef6c6 in ap_invoke_handler ()
#19 0x0000556205306ba2 in ap_process_async_request ()
#20 0x0000556205306d50 in ap_process_request ()
#21 0x0000556205302e1e in ?? ()
#22 0x00005562052f90f0 in ap_run_process_connection ()
#23 0x00007ff1145537e9 in ?? () from /usr/lib/apache2/modules/mod_mpm_prefork.so
#24 0x00007ff114553a74 in ?? () from /usr/lib/apache2/modules/mod_mpm_prefork.so
#25 0x00007ff114553aeb in ?? () from /usr/lib/apache2/modules/mod_mpm_prefork.so
#26 0x00007ff114554ac7 in ?? () from /usr/lib/apache2/modules/mod_mpm_prefork.so
#27 0x00005562052d179e in ap_run_mpm ()
#28 0x00005562052ca690 in main ()
我使用带有 Pecl 包的 Apache 2.4.18 和 PHP 7.2.13:
Installed packages, channel pecl.php.net:
=========================================
Package Version State
amqp 1.9.4 stable
igbinary 2.0.8 stable
mongodb 1.4.4 stable
oauth 2.0.3 stable
redis 4.2.0 stable
zmq 1.1.3 beta
我还使用 NewRelic PHP Agent,已安装的 PHP 包的完整列表:
php-common/xenial,xenial,now 2:69+ubuntu16.04.1+deb.sury.org+1 all [installé, automatique]
php-pear/xenial,xenial,now 1:1.10.6+submodules+notgz-1+ubuntu16.04.1+deb.sury.org+2 all [installé, automatique]
php-xml/xenial,xenial,now 2:7.2+69+ubuntu16.04.1+deb.sury.org+1 all [installé, automatique]
php7.2/xenial,xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 all [installé]
php7.2-bcmath/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-cli/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-common/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-curl/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-dev/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-gd/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-json/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-mbstring/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-mysql/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-opcache/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-pspell/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-readline/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-soap/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-tidy/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
php7.2-xml/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé, automatique]
php7.2-zip/xenial,now 7.2.13-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
为了迁移我的 PHP,我删除并清除了包和 Pecl 包...
我开始认为我在迁移过程中可能做得不好...如果有人可以帮助我......
答案1
您能否切换LogLevel debug
到 http.conf 并发布输出?这将向您显示分段错误之前执行的 PID。就我而言,Dynatrace 导致了分段错误mod_authz_core
。更可能的是,这是由单独进程使用的依赖项导致的问题。