getting error while enabling curl in php5 ubuntu - php

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.

Related

Woo commerce Error: How to enable soap client on debian server?

I have deployed WordPress on debian VM on GCP.
I am getting an error:
Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
I have run below commands to install soap client:
sudo apt-get install php-soap
After installation, it is still same showing same error.
When I checked the php version, it shows below warning
PHP Warning: PHP Startup: Unable to load dynamic library 'soap' (tried: /usr/lib/php/20190902/soap (/usr/lib/php/20190902/soap: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/soap.so (/usr/lib/php/20190902/soap
.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
What to do to remove this error?
Seems to be that the php7.3-soap package is corrupted, please try reinstalling it and after that restart the Apache service, then validate the error is no longer present.
$ sudo apt-get reinstall php7.3-soap
$ php -m | grep soap
$ php -v
Please note that Debian 10 (buster) default Php version is 7.3.

Ubuntu wrong path to oci8.so [duplicate]

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

cURL not loading for Ubuntu 16.04.3 with PHP 5.6

I have a Ubuntu 16.04.3 server that when I use phpinfo() I find that the server is using PHP Version 5.6.11 on Apache/2.4.18.
I installed curl and when I run sudo find / -name curl.so\* I get returned
/usr/lib/php/20151012/curl.so
phpinfo() shows the following additional .ini file: /etc/php5/apache2/conf.d/99-curl.ini
The contents of this file are extension=/usr/lib/php/20151012/curl.so
When I run the following on a php page:
var_dump(function_exists('curl_init')); print
I get bool(false)
This occurs even after a sudo service apache2 restart
How do I get CURL to run in my PHP pages?
Most likely, the reason it is not loading is because the API version 20151012 is for PHP 7.0 and not 5.6, so that curl extension module is not compatible with 5.6.
If you do sudo apt-get install php5-curl you should get the right extension which should get installed to /usr/lib/php/20131226.
The Apache error log should have a startup error saying that the module is not compatible and might offer more detail as to why it's not being loaded.

PHP7.0 - unable to load dynamic library oci8.so (Ubuntu)

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

Install PHP modules on CentOS

I'm trying to install PHP 5.5.21 on CentOS 7.0.
When I execute php -v
I get about 10 modules errors like this one:
PHP Warning: PHP Startup: curl: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
I tryed to install or update package with pecl install curl and pecl upgrade curl
But pecl always responds :
No releases available for package "pecl.php.net/curl"
And yum install php-curl says:
Package php-common-5.4.16-23.el7_0.3.x86_64 already installed and latest version
Nothing to do
How can I do to fix modules error?
Try running: find / -name curl.so
Then copy the directory it finds curl.so in and create a symbolic link to it where the rest of your working .so files are stored:
cd <where your working .so files are>
ln -s <where curl.so is> curl.so
Then edit your php.ini file and enable the extension:
extension=curl.so
Restart apache:
service httpd restart
service apache2 restart `#If the service is named apache2 rather than httpd`
This resolved my problem when I had a similar issue.
I finally solved my problem removing the custom PHP installation and using this tutorial to install PHP 5.5

Categories