简体   繁体   中英

Can not load PostgreSQL driver when reinstall php on mac (El Capitan)

The first time I install php7, every thing work well:

brew install php70
brew install php70-pdo-pgsql

But when I remove it, install php56, remove php56 and reinstall php70 then I got errors:

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so' - dlopen(/usr/local/opt/php70-pdo-pgsql/pdo_pgsql.so, 9): image not found in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php70-pthreads/pthreads.so' - dlopen(/usr/local/opt/php70-pthreads/pthreads.so, 9): image not found in Unknown on line 0

How can I fix it?

I've found the answer. We just remove and reinstall these extensions from source.

brew unlink php70-pdo-pgsql
brew unlink php70-pthreads
brew reinstall php70-pdo-pgsql --build-from-source
brew reinstall php70-pthreads --build-from-source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM