I want to run php's built-in server (running by $ php -S localhost:8888) with PDO extension.
But when I type this command into terminal it gives me:
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
(And when I try to use it it says that PDO class not found)
The same is when I run just $ php. But when I start apache2 server everything looks good (the PDO extension is working).
And the file /usr/lib/php5/20121212/pdo_mysql.so exists.
Thanks for your answers!
(running php 5 on ubuntu)
I've finally solved by reinstalling php:
Uninstall php with purge parameter:
sudo apt-get --purge remove php5-common
And install again:
sudo apt-get install php5 php5-mysql php5-curl etc...
Source: Error In PHP5 ..Unable to load dynamic library
Related
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!
After following the install instructions for oracle instant client, php is not able to load the oci8 extension.
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
I am getting an error.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0
I have verified both oci8.so and libmql1.so locations.
Am I missing something?
I'm using Ubuntu 16.04 and php version 7.1
There are few directories in /usr/lib/php/
for example
20131226 for php5.6
20160303 for php7.1
so problem with me that, the oci8 extension got installed on the wrong ( a user lib folder for php7.2) so I had to remove the php 7.2 completly
sudo apt-get purge php7.2-common
then I had uninstall the oci8 by running following command
sudo pecl uninstall oci8
and install again by running the following command
sudo pecl install oci8
To check the configuration loaded you do
php-config --extension-dir
And make sure that all extension are installed in the correct extension directory.
Make changes in the /etc/php/7.1/apache2/php.ini and /etc/php/7.1/cli/php.ini
Check by running phpinfo(); You must see this, ignore the cli if that stills gives you same error as your web shows the extension is getting loaded.
I solved adding the following to /etc/environment:
LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH
I followed this tutorial: https://gist.github.com/hewerthomn/81eea2935051eb2500941a9309bca703
What I did was completely remove any installations of PHP and reinstall the version that I need.
sudo apt-get purge 'php*'
Source: https://askubuntu.com/a/59889/226518
Or:
export LD_LIBRARY_PATH=/usr/local/instantclient_12_1/
I had the same problem, it works for me.
After wasting entire day for this small problem finally I came with this solution.
Sorry guys I am not champion is PHP but somehow I manage.
In my system I have CentOS 7 and PHP 7.4.XX.
I changed my LD_LIBRARY_PATH,
I have restarted my httpd service and checked phpinfo in browser (http://localhost/info.php),
Last I restared php-fpm service ........... and it's work for me.
Thanking you,
Anand
After following the install instructions for oracle instant client, php is not able to load the oci8 extension.
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst
I am getting an error.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0
I have verified both oci8.so and libmql1.so locations.
Am I missing something?
I'm using Ubuntu 16.04 and php version 7.1
There are few directories in /usr/lib/php/
for example
20131226 for php5.6
20160303 for php7.1
so problem with me that, the oci8 extension got installed on the wrong ( a user lib folder for php7.2) so I had to remove the php 7.2 completly
sudo apt-get purge php7.2-common
then I had uninstall the oci8 by running following command
sudo pecl uninstall oci8
and install again by running the following command
sudo pecl install oci8
To check the configuration loaded you do
php-config --extension-dir
And make sure that all extension are installed in the correct extension directory.
Make changes in the /etc/php/7.1/apache2/php.ini and /etc/php/7.1/cli/php.ini
Check by running phpinfo(); You must see this, ignore the cli if that stills gives you same error as your web shows the extension is getting loaded.
I solved adding the following to /etc/environment:
LD_LIBRARY_PATH=/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH
I followed this tutorial: https://gist.github.com/hewerthomn/81eea2935051eb2500941a9309bca703
What I did was completely remove any installations of PHP and reinstall the version that I need.
sudo apt-get purge 'php*'
Source: https://askubuntu.com/a/59889/226518
Or:
export LD_LIBRARY_PATH=/usr/local/instantclient_12_1/
I had the same problem, it works for me.
After wasting entire day for this small problem finally I came with this solution.
Sorry guys I am not champion is PHP but somehow I manage.
In my system I have CentOS 7 and PHP 7.4.XX.
I changed my LD_LIBRARY_PATH,
I have restarted my httpd service and checked phpinfo in browser (http://localhost/info.php),
Last I restared php-fpm service ........... and it's work for me.
Thanking you,
Anand
I have installed curl in ubuntu server using this command
sudo apt-get install curl php5-cli git
it's succeeded now i am trying to enable this extension in php on linux platform.so i commented out the extension=php_curl.dll line in php.ini .But it giving this error
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20131226/curl.so' - /usr/lib/php/20131226/php_curl.dll:
cannot open shared object file: No such file or directory in Unknown
on line 0
i got this error while confirming the whether curl is enabled in php with this command
php -i | grep curl
please help with me how to enable curl extension in php on linux platform
You've installed Curl, and you've installed PHP, but I think you are missing the PHP-Curl integration libraries.
sudo apt-get install php5-curl
This is available from the main repository in 14.04 - http://packages.ubuntu.com/trusty/php5-curl
However from 16.04 onwards only PHP7 is included by default, so you'll probably have to use a 3rd-party PPA.
I installed mongodb php-driver as per the guideline shown here:
https://github.com/mongodb/mongo-php-driver
But when I run #php command its showing following error :
Warning: PHP Startup: Unable to load dynamic library
'/opt/lampp/lib/php/extensions/no-debug-non-zts-20151012/mongodb.so' -
/opt/lampp/lib/php/extensions/no-debug-non-zts-20151012/mongodb.so: symbol
CRYPTO_get_locking_callback, version OPENSSL_1.0.0 not defined in file
libcrypto.so.1.0.0 with link time reference in Unknown on line 0
I am using :
Lampp Stack
PHP : 7.0.0
OS: Ubuntu 15.10
Pear: 1.10.1
Please suggest any solution if you have. Thanks in advance .
It looks like you don't have SSL library enabled/installed correctly on your system. Most likely, I am thinking you don't have the libssl-dev package installed.
You should install this with apt-get install libssl-dev libsasl2-dev, and then reinstall the mongodb extension with pecl uninstall mongodb && pecl install mongodb.