Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

PDO não encontrado

~/Documentos/dev/alura/laravel/projeto-inicial/src
php conexao-bd.php
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20220829/pdo_mysql (/usr/lib/php/20220829/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdo_mysql.so (/usr/lib/php/20220829/pdo_mysql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module "curl" is already loaded in Unknown on line 0
PHP Fatal error:  Uncaught PDOException: could not find driver in /home/gabrielbartolace/Documentos/dev/alura/laravel/projeto-inicial/src/conexao-bd.php:2
Stack trace:
#0 /home/gabrielbartolace/Documentos/dev/alura/laravel/projeto-inicial/src/conexao-bd.php(2): PDO->__construct()
#1 {main}
  thrown in /home/gabrielbartolace/Documentos/dev/alura/laravel/projeto-inicial/src/conexao-bd.php on line 2

depois das alterações eu tbm reiniciei o apache com sudo service apache2 restart e não foi

eu ativei o pdo no caminho que o php --ini indica, mas esse erro aparece, consegue me ajudar ?

~/Documentos/dev/alura/laravel/projeto-inicial/src
php --ini
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20220829/pdo_mysql (/usr/lib/php/20220829/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdo_mysql.so (/usr/lib/php/20220829/pdo_mysql.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  Module "curl" is already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc/php/8.2/cli
Loaded Configuration File:         /etc/php/8.2/cli/php.ini
Scan for additional .ini files in: /etc/php/8.2/cli/conf.d
Additional .ini files parsed:      /etc/php/8.2/cli/conf.d/10-opcache.ini,
/etc/php/8.2/cli/conf.d/10-pdo.ini,
/etc/php/8.2/cli/conf.d/15-xml.ini,
/etc/php/8.2/cli/conf.d/20-calendar.ini,
/etc/php/8.2/cli/conf.d/20-ctype.ini,
/etc/php/8.2/cli/conf.d/20-curl.ini,
/etc/php/8.2/cli/conf.d/20-dom.ini,
/etc/php/8.2/cli/conf.d/20-exif.ini,
/etc/php/8.2/cli/conf.d/20-ffi.ini,
/etc/php/8.2/cli/conf.d/20-fileinfo.ini,
/etc/php/8.2/cli/conf.d/20-ftp.ini,
/etc/php/8.2/cli/conf.d/20-gettext.ini,
/etc/php/8.2/cli/conf.d/20-iconv.ini,
/etc/php/8.2/cli/conf.d/20-phar.ini,
/etc/php/8.2/cli/conf.d/20-posix.ini,
/etc/php/8.2/cli/conf.d/20-readline.ini,
/etc/php/8.2/cli/conf.d/20-shmop.ini,
/etc/php/8.2/cli/conf.d/20-simplexml.ini,
/etc/php/8.2/cli/conf.d/20-sockets.ini,
/etc/php/8.2/cli/conf.d/20-sysvmsg.ini,
/etc/php/8.2/cli/conf.d/20-sysvsem.ini,
/etc/php/8.2/cli/conf.d/20-sysvshm.ini,
/etc/php/8.2/cli/conf.d/20-tokenizer.ini,
/etc/php/8.2/cli/conf.d/20-xmlreader.ini,
/etc/php/8.2/cli/conf.d/20-xmlwriter.ini,
/etc/php/8.2/cli/conf.d/20-xsl.ini

depois das alterações tbm reiniciei o serve com sudo service apache2 restart mas não foi

1 resposta
solução!

Estou no Ubuntu, resolvi o erro com ajuda do https://stackoverflow.com/questions/62240102/php-warning-php-startup-unable-to-load-dynamic-library-pdo-mysql-so.

I solved the problem this way:

sudo apt-get --purge remove php-common

sudo apt-get install php-common php-mysql php-cli

Now there is no error and php -m shows it has everything