服务器新安装的php,发现通过apache走web访问方式好好的。但是通过命令行方式出现报错,如下:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/php_mysqli.dll' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/php_mysqli.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/php_openssl.dll' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/php_openssl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
报错原因:
PHP启动:无法加载动态库php_mysqli.dll、php_openssl.dll,在扩展目录没有找到文件。
解决方案:
编辑php.ini文件,将对应php_mysqli.dll、php_openssl.dll的行注释掉,如下图
重启php:
/usr/local/php7/sbin/php-fpm restart
成功解决