我的 CentOS 7 Apache 服务器上有两个版本的 PHP:
- 5.6
- 7.2
它曾经运行过,但现在我收到一些我无法解读或用来调试的奇怪错误。
正在做:
$ sudo service php72-php-fpm restart
给我看了这个:
Job for php72-php-fpm.service failed because a fatal signal was delivered causing the control process to dump core. See "systemctl status php72-php-fpm.service" and "journalctl -xe" for details.
跑步:
$ systemctl status php72-php-fpm.service
显示:
php72-php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php72-php-fpm.service; enabled; vendor preset: disabled)
Active: failed (Result: core-dump) since Tue 2019-04-09 12:09:33 BST; 40s ago
Process: 15205 ExecStart=/opt/remi/php72/root/usr/sbin/php-fpm --nodaemonize (code=dumped, signal=SEGV)
Main PID: 15205 (code=dumped, signal=SEGV)
Apr 09 12:09:32 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
Apr 09 12:09:32 localhost.localdomain php-fpm[15205]: [09-Apr-2019 12:09:32] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'oci8' (tried: /opt/remi/php72/root/usr/lib64/php/modules/oci8 (/opt/remi/php72...
Apr 09 12:09:32 localhost.localdomain php-fpm[15205]: [09-Apr-2019 12:09:32] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: /opt/remi/php72/root/usr/lib64/php/modules/pdo_oci (/opt/remi...
Apr 09 12:09:33 localhost.localdomain systemd[1]: php72-php-fpm.service: main process exited, code=dumped, status=11/SEGV
Apr 09 12:09:33 localhost.localdomain systemd[1]: Failed to start The PHP FastCGI Process Manager.
Apr 09 12:09:33 localhost.localdomain systemd[1]: Unit php72-php-fpm.service entered failed state.
Apr 09 12:09:33 localhost.localdomain systemd[1]: php72-php-fpm.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
和
$ journal -xe
与服务无关。
我该如何调试和修复这个问题?
答案1
从粘贴的错误来看,您安装了 oci8 扩展,但没有 oracle 库(版本 18.3)。
从以下位置安装库Oracle 网站,并修复 FPM 的 LD_LIBRARY_PATH。
您可以
- 全局设置链接器路径(适用于所有 SAPI)
echo /usr/lib/oracle/18.3/client64/lib >>/etc/ld.so.conf.d/oracle.conf
或者
- 设置FPM服务环境(仅适用于FPM)
systemctl edit php72-php-fpm
并在那里添加环境指令
[Service]
Environment=LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib
如果你不需要此扩展,只需将其删除即可
yum remove php72-php-oci8
它本来可以运行,但现在我收到了一些奇怪的错误......
如果从以前的版本更新,使用旧的客户端库版本构建,则还需要更新该库。
答案2
您发布的日志暗示 oracle 参与其中。很可能您缺少必需的依赖项。请仔细检查您安装的 oracle 软件包,如果这不能解决您的问题,请提供列表。