PHP Warning: PHP Startup: igbinary: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20180731
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: redis: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20180731
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20180731
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'swoole.so' (tried: /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so (/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so: cannot open shared object file: No such file or directory), /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so.so (/www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20180731
These options need to match
in Unknown on line 0
Workerman[think] stop
Workerman[think] is stopping ...
Workerman[think] stop success
You have new mail in /var/spool/mail/root,检查下提示,这是什么问题
提示如上错误,说明PHP 扩展版本与当前 PHP 版本不兼容,核心错误信息如下:
bash
Module compiled with module API=20190902
PHP compiled with module API=20180731
These options need to match
问题原因
-
module API=20180731对应的是 PHP 7.3 -
module API=20190902对应的是 PHP 7.4
那么如何切换PHP版本
bash
# 1. 删除旧链接
rm -f /usr/bin/php
# 2. 创建新链接
ln -s /www/server/php/74/bin/php /usr/bin/php
# 3. 验证
php -v