PHP安装,创建完软连接,第一次使用 php -m查看扩展正常
但是在调用软连接:php -v 或者 php -m 会出现以下错误
PHP Warning: PHP Startup: Unable to load dynamic library 'bz2' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/bz2 (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/bz2: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/bz2.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/bz2.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'calendar' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/calendar (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/calendar: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/calendar.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/calendar.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ctype' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ctype (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ctype: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ctype.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ctype.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/curl (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/curl: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/curl.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/curl.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'dom' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/dom (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/dom: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/dom.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/dom.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'exif' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/exif (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/exif: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/exif.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/exif.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/fileinfo (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/fileinfo: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/fileinfo.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'ftp' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ftp (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ftp: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ftp.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/ftp.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'gettext' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/gettext (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/gettext: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/gettext.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/gettext.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'iconv' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/iconv (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/iconv: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/iconv.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/iconv.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'phar' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/phar (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/phar: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/phar.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/phar.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'posix' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/posix (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/posix: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/posix.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/posix.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'shmop' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/shmop (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/shmop: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/shmop.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/shmop.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'simplexml' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/simplexml (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/simplexml: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/simplexml.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/simplexml.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'sockets' (tried: /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/sockets (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/sockets: cannot open shared object file: No such file or directory), /usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/sockets.so (/usr/local/php8/lib/php/extensions/no-debug-non-zts-20210902/sockets.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
每次处理这个问题都要浪费好长时间(在遇到3次以上后,我终于决定,把方法记录下来) 找到自己的编译配置 我的是 /etc/php.d 会看到对应的*.ini文件 进入后看到
; Enable bz2 extension module
extension=bz2
变更为
; Enable bz2 extension module
;extension=bz2
即可。 记得每个ini的文件中的extension前都要加“;”号
也许你遇到的问题与我的不一样,请找其它解决方法
为了下次不再想好久,好烦
|