2
respostas

[Linux/Ubuntu] Problemas ao rodar create-project

Qual orientação para os erros abaixo?

usuario2@usuario2:~/Dev/PHP/Laravel$ composer create-project --prefer-dist laravel/laravel controle-series 5.8.*

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20190902/pdo_sqlite (/usr/lib/php/20190902/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlite.so (/usr/lib/php/20190902/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20190902/pdo_sqlite (/usr/lib/php/20190902/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlite.so (/usr/lib/php/20190902/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0 PHP Warning: Module 'mbstring' already loaded in Unknown on line 0

Warning: Module 'mbstring' already loaded in Unknown on line 0 Creating a "laravel/laravel" project at "./controle-series" Installing laravel/laravel (v5.8.35)

  • Installing laravel/laravel (v5.8.35): Extracting archive Created project in /home/usuario2/Dev/PHP/Laravel/controle-series

    @php -r "file_exists('.env') || copy('.env.example', '.env');"

PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20190902/pdo_sqlite (/usr/lib/php/20190902/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlite.so (/usr/lib/php/20190902/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20190902/pdo_sqlite (/usr/lib/php/20190902/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlite.so (/usr/lib/php/20190902/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0 PHP Warning: Module 'mbstring' already loaded in Unknown on line 0

Warning: Module 'mbstring' already loaded in Unknown on line 0 Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages.

Problem 1

- phpunit/phpunit[7.5.0, ..., 7.5.20] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
- Root composer.json requires phpunit/phpunit ^7.5 -> satisfiable by phpunit/phpunit[7.5.0, ..., 7.5.20].

To enable extensions, verify that they are enabled in your .ini files:

- /etc/php/7.4/cli/php.ini
- /etc/php/7.4/cli/conf.d/10-opcache.ini
- /etc/php/7.4/cli/conf.d/10-pdo.ini
- /etc/php/7.4/cli/conf.d/20-calendar.ini
- /etc/php/7.4/cli/conf.d/20-ctype.ini
- /etc/php/7.4/cli/conf.d/20-exif.ini
- /etc/php/7.4/cli/conf.d/20-ffi.ini
- /etc/php/7.4/cli/conf.d/20-fileinfo.ini
- /etc/php/7.4/cli/conf.d/20-ftp.ini
- /etc/php/7.4/cli/conf.d/20-gettext.ini
- /etc/php/7.4/cli/conf.d/20-iconv.ini
- /etc/php/7.4/cli/conf.d/20-json.ini
- /etc/php/7.4/cli/conf.d/20-mbstring.ini
- /etc/php/7.4/cli/conf.d/20-pdo_sqlite.ini
- /etc/php/7.4/cli/conf.d/20-phar.ini
- /etc/php/7.4/cli/conf.d/20-posix.ini
- /etc/php/7.4/cli/conf.d/20-readline.ini
- /etc/php/7.4/cli/conf.d/20-shmop.ini
- /etc/php/7.4/cli/conf.d/20-sockets.ini
- /etc/php/7.4/cli/conf.d/20-sqlite3.ini
- /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.4/cli/conf.d/20-sysvsem.ini
- /etc/php/7.4/cli/conf.d/20-sysvshm.ini
- /etc/php/7.4/cli/conf.d/20-tokenizer.ini

You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Desde já agradeço!

2 respostas

Tá aqui seu erro, Irfley:

Unable to load dynamic library 'pdo_sqlite'

Você alterou seu php.ini e descomentou o extension=pdo_sqlite, né!? Desfaz essa alteração e instala a extensão do sqlite. Normalmente é algo como sudo apt install php-sqlite3.

Olá Irfley,

Uma boa dica também é usar docker ou vagrant (tem cursos na Alura)

... que você pode definir uma configuração via código e sempre pronta para uso no Laravel. sem sofrer alterações ao usar como servidor principal na sua máquina.

O Vinícius acertou sobre a falta do módulo no teu servidor com php. 1) Ative o modulo no php.ini 2) Se não tiver ele, precisa instalar e depois ativar.

Veja esta reposta solucionada sobre o mesmo assunto https://cursos.alura.com.br/forum/topico-primeira-conexao-com-o-pdo-68116

Por favor, se resolver, marque esta conversa como solucionado.

Atenciosamente Léo Moraes