PHP Startup: Unable to load dynamic library 'pgsql.so' - php

I have an application in symfony using doctrine and PGSQL.
I'm using MacOsx BigSur.
When I run my projet I have this error:
PHP Startup: Unable to load dynamic library 'pgsql.so'
I have install php#7.3 with brew install php#7.3
In the /etc/php.ini I added the line extension=pgsql.so of the end of file.
I have restart my services with: brew services restart php#7.3
When I run php -v I have a warning : PHP Startup: Unable to load dynamic library 'pgsql.so'
And when I run my symfony application I have this error:
In AbstractPostgreSQLDriver.php line 79:
An exception occurred in driver: could not find driver
In PDOConnection.php line 31:
could not find driver
In PDOConnection.php line 27:
could not find driver
How can I install pgsql to run my application correctly ?
Thanks

To resolve my problem I have installed php#7.3 with brew
brew install php#7.3
After that you need to do:
echo ‘export PATH=“/usr/local/opt/php#7.3/bin:$PATH”’ >> ~/.profile
echo ‘export PATH=“/usr/local/opt/php#7.3/sbin:$PATH”’ >> ~/.profile
You can run again and that's work.

Related

How to install pdo_mysql driver on OSX Catalina?

When I ran a script that uses PDO, I received an error from the console:
Can't connect to database: could not find driver
After which I read that I need to uncomment the line with pdo_mysql in php.ini. Unfortunately, this led to the following error now popping up in me:
Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql'
PHP set through brew install php#7.2
I tried to install via pecl, but it produces:
running: make INSTALL_ROOT="/private/tmp/pear/temp/pear-build-artemsokoloviZ2ILB/install-
PDO-1.0.3" install
Installing shared extensions: /private/tmp/pear/temp/pear-build-artemsokoloviZ2ILB/install-PDO-1.0.3/usr/local/Cellar/php#7.2/7.2.31_1/pecl/20170718/
cp: modules/*: No such file or directory
make: *** [install-modules] Error 1
ERROR: `make INSTALL_ROOT="/private/tmp/pear/temp/pear-build-artemsokoloviZ2ILB/install-PDO-1.0.3" install' failed

MacOS Mojave + PHP 7.1.23 + IMAP configuration

I want to use imap_append command in my PHP code. But, when I enabled extension=php_imap.dll in the /etc/php.ini file on my Mac, I am seeing following warning when I fire any PHP command:
Example:
php --version
gives output:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/php_imap.dll' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/php_imap.dll, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20160303/php_imap.dll in Unknown on line 0
I have already tried installing following but no use:
brew tap kabel/php-ext
brew install php-imap
brew install php#7.1-imap
Any clue?

Laravel and Brew installation with PHP and PDO

I have just moved from linux to mac and am having some issues installing PHP with the right drivers for Laravel.
I ran brew install homebrew/php/php56-mysqlnd_ms
but now I keep getting this error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
phpinfo()
PHP Version => 5.6.21
Does anybody know how to fix this error? I am at a loss
You are missing mcrypt . You can try ,
brew install php54-mcrypt --without-homebrew-php
And then , in /etc/php.ini add,
extension="/usr/local/Cellar/php54-mcrypt/5.4.24/mcrypt.so"
I hope this will help , please let us know
Seems that you have to install the module mcrypt of php.
brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
sudo composer update
Other thing that if you want to use mac and linux you can use Vagrant, is really nice how it works with virtualbox + vagrant you can have stack on other OS.
https://www.vagrantup.com/
And this is a nice project with vagrant for install all the the technologies you need.
https://github.com/fideloper/Vaprobash

How to properly setup php_gmp on OSX with xampp

I've installed XAMPP on osx 10.10 .
I need php_gmp so i tried to setup it using:
$ brew install php55 --with-gmp
Then, I activated the dependency by modifing php.ini
extension=gmp.so
Apache restarted does not work, so i tried to activate in php.ini:
extension=php_gmp.so
Resterting the server but nothing anyway
PHP error Log
[24-Mar-2016 08:00:26 Europe/Berlin] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/php_gmp.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/php_gmp.so, 9): image not found in Unknown on line 0
[24-Mar-2016 08:00:26 Europe/Berlin] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/gmp.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/gmp.so, 9): image not found in Unknown on line 0
Try reinstalling it but using the code
brew install homebrew/php/php55-gmp

php artisan migrate [PDOException] could not find driver

When I write command "php artisan migrate" from mysql connection,linux terminal gives this error :[PDOException] could not find driver.
When I add to
php.ini
extension=pdo.so
extension=pdo_mysql.so
,
error has changing like this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/pdo_mysql.so' - /usr/lib/php5/20121212/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: Module 'PDO' already loaded in Unknown on line 0
[PDOException]
could not find driver
How can we solve this issue?
Thanks
Hi you need to install php pdo driver
Open terminal
sudo apt-get install php5-mysql
Restart Apache server
sudo service apache2 restart

Categories