composer cannot find pdo_mysql php extension - php

When I tried to run PHP composer command : php -c /etc/php5/apache2/php.ini ~/composer.phar
install, the composer returns the following message and I cannot run the laravel framework.
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20121212/pdo_mysql.so' - /usr/lib/php5/20121212/pdo_mysql.so: undefined
symbol: pdo_parse_params in Unknown on line 0
Script php artisan clear-compiled handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20121212/pdo_mysql.so' - /usr/lib/php5/20121212/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0
I googled, and I tried run sudo apt-get install php5-mysql, it saids php5-mysql already the
newest. And I tried to run command sudo php5enmod pdo_mysql. But I run the php composer
again, same error happened. It seems php5 cannot find pdo_mysql. I believed it may caused by
PHP installation. I tried to remove the PHP5 mannually. So how can I make PHP find the
pdo_mysql again? Thanks

Related

Self-built mysqlnd throws PHP Startup: Invalid library (maybe not a PHP library) 'mysqlnd.so'

I used this helper script to build PHP 7.1.33 under Debian 7: https://github.com/kasparsd/php-7-debian
In general it works fine. However, even though the configure options have --with-pdo-mysql, the extension was not built. So I went ahead and built separately like so:
in php-src/ext/mysqlnd:
cp config9.m4 ./config.m4
/usr/local/php7/bin/phpize
PHP_OPENSSL_DIR="yes" ./configure --with-php-config=/usr/local/php7/bin/php-config
make
sudo cp modules/mysqlnd.so /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
in php-src/ext/pdo_mysql:
/usr/local/php7/bin/phpize
./configure --with-php-config=/usr/local/php7/bin/php-config
ln -s /home/user/php-7-debian/php-src/ext/ /home/user/php-7-debian/php-src/ext/pdo_mysql
make
sudo cp modules/pdo_mysql.so /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/
Added to /usr/local/php7/etc/conf.d/modules.ini:
extension=mysqlnd.so
extension=pdo_mysql.so
Now php -m gives
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'mysqlnd.so' in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/pdo_mysql.so' - /usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/pdo_mysql.so: undefined symbol: mysqlnd_allocator in Unknown on line 0
What might be the problem?

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?

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysql.so'

I recently installed EHCP with all the necessary packages and now everytime I try to run my laravel project by typing php artisan serve, I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20151012/mysql.so' - /usr/lib/php/20151012/mysql.so:
cannot open shared object file: No such file or directory in Unknown
on line 0
Please help, thank you.
Do you have the mysql extension installed? If not, you may need to install it.
apt-get install php-mysql
In ubuntu 16.04 and above (as I can remember), this will install the module for PHP7 by default. So you need to check your php version and install the relevant one.
Ex: apt-get install php5.6-mysql
Then check you have the module installed by running:
php -m | grep mysql
Hope it helps!

Error In PHP5 ..Unable to load dynamic library gd.so

litingjun#litingjun-All-Series:/etc/php5/cli/conf.d$ php -a
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/gd.so' - /usr/lib/php5/20121212/gd.so: undefined symbol: gdImageCreateFromGd2Part in Unknown on line 0
litingjun#litingjun-All-Series:/etc/php5/cli/conf.d$ ls /usr/lib/php5/20121212/gd.so
/usr/lib/php5/20121212/gd.so
I've tried reinstalling gd using sudo apt-get install php5-gd but still not work.
My PHP version: 5.5.9-1ubuntu4.11
I need gd.
Thanks
I've reinstalled my OS and problem's gone.

imagick install problerm:undefined symbol: MagickGetImageBluePrimary in Unknown on line 0

Recently i want to add webp support for my imagemagick.
I install libwebp-0.3.1 and imagemagick-6.8 correctly,but after i install imagick-3.0.1 successfully , I run cmd:
$:php -m | grep "imagick"
it shows:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - /usr/lib64/php/modules/imagick.so: undefined symbol: MagickGetImageBluePrimary in Unknown on line 0
so i change to imagick-2.3.0,surely it works.But anyone find solution to work with imagick-3.0.1????
any help will be appreciated
Solution is to help the future commands to find MagickWand with the command
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
then config and install imagick-3.0.0 or imagick-3.0.1:
./configure
make
make install
The answer link is here:
http://semigr.livejournal.com/97622.html

Categories