PHP 7.4 Extensions Such as SQLite3 Not Built by Default

Viewed 607

I've installed PHP 7.4.11 on macOS using Homebrew.

When I tried to enable extensions which are built with PHP, such as sqlite3 and pdo_sqlite, the extensions couldn't be found, as implied from the following warnings:

PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/local/lib/php/pecl/20190902/pdo_sqlite (dlopen(/usr/local/lib/php/pecl/20190902/pdo_sqlite, 9): image not found), /usr/local/lib/php/pecl/20190902/pdo_sqlite.so (dlopen(/usr/local/lib/php/pecl/20190902/pdo_sqlite.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/local/lib/php/pecl/20190902/pdo_sqlite (dlopen(/usr/local/lib/php/pecl/20190902/pdo_sqlite, 9): image not found), /usr/local/lib/php/pecl/20190902/pdo_sqlite.so (dlopen(/usr/local/lib/php/pecl/20190902/pdo_sqlite.so, 9): image not found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'sqlite3' (tried: /usr/local/lib/php/pecl/20190902/sqlite3 (dlopen(/usr/local/lib/php/pecl/20190902/sqlite3, 9): image not found), /usr/local/lib/php/pecl/20190902/sqlite3.so (dlopen(/usr/local/lib/php/pecl/20190902/sqlite3.so, 9): image not found)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: /usr/local/lib/php/pecl/20190902/sqlite3 (dlopen(/usr/local/lib/php/pecl/20190902/sqlite3, 9): image not found), /usr/local/lib/php/pecl/20190902/sqlite3.so (dlopen(/usr/local/lib/php/pecl/20190902/sqlite3.so, 9): image not found)) in Unknown on line 0

In my extension's directory, /usr/local/lib/php/pecl/20190902/, there is not a single file. I expected shared object (.so) files for all the extensions built with PHP.

I also tried installing PHP 8.0 using the command brew install php --HEAD, but the problem persists. According to the Homebrew formula for PHP, all these extensions such as sqlite3, pdo_sqlite, etc should be built with PHP.

Can anyone tell me how I can resolve this issue?

0 Answers
Related