1
resposta

Atualizar versão do php

Olá, bom dia. Estava acompanhando um curso de php para me atualizar de algumas novidades, e no curso recomendou utilizar a versão mais recente. Acontecem que eu tenho algumas versões instaladas, e quando eu alterei a versão para o php 8.2 comecei a ter alguns warning

PHP Warning:  Failed loading Zend extension 'opcache' (tried: ext/opcache (ext/opcache: cannot open shared object file: No such file or directory), ext/opcache.so (ext/opcache.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Failed loading Zend extension 'opcache.so' (tried: ext/opcache.so (ext/opcache.so: cannot open shared object file: No such file or directory), ext/opcache.so.so (ext/opcache.so.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 'mysqlnd.so' (tried: ext/mysqlnd.so (ext/mysqlnd.so: cannot open shared object file: No such file or directory), ext/mysqlnd.so.so (ext/mysqlnd.so.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 'pdo.so' (tried: ext/pdo.so (ext/pdo.so: cannot open shared object file: No such file or directory), ext/pdo.so.so (ext/pdo.so.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 'xml.so' (tried: ext/xml.so (ext/xml.so: cannot open shared object file: No such file or directory), ext/xml.so.so (ext/xml.so.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.so' (tried: ext/calendar.so (ext/calendar.so: cannot open shared object file: No such file or directory), ext/calendar.so.so (ext/calendar.so.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.so' (tried: ext/ctype.so (ext/ctype.so: cannot open shared object file: No such file or directory), ext/ctype.so.so (ext/ctype.so.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.so' (tried: ext/curl.so (ext/curl.so: cannot open shared object file: No such file or directory), ext/curl.so.so (ext/curl.so.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.so' (tried: ext/dom.so (ext/dom.so: cannot open shared object file: No such file or directory), ext/dom.so.so (ext/dom.so.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.so' (tried: ext/exif.so (ext/exif.so: cannot open shared object file: No such file or directory), ext/exif.so.so (ext/exif.so.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 'ffi.so' (tried: ext/ffi.so (ext/ffi.so: cannot open shared object file: No such file or directory), ext/ffi.so.so (ext/ffi.so.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.so' (tried: ext/fileinfo.so (ext/fileinfo.so: cannot open shared object file: No such file or directory), ext/fileinfo.so.so (ext/fileinfo.so.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.so' (tried: ext/ftp.so (ext/ftp.so: cannot open shared object file: No such file or directory), ext/ftp.so.so (ext/ftp.so.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 'gd.so' (tried: ext/gd.so (ext/gd.so: cannot open shared object file: No such file or directory), ext/gd.so.so (ext/gd.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

obs.: Esse é alguns dos erros apenas, existem mais, mas todos relacionados as extensões tenho todo os pacotes instalados nesta versão, editei o php.ini para habilitar as libs da warning, mas mesmo assim estou com o problema acima.

Alguem consegue me ajudar? Estou usando Ubuntu 22.04

1 resposta

Você precisa ir no php.ini e mudar o diretório que as extensões estão sendo carregadas. Ou, mover as extensões novas para o diretório antigo que é ext/.