Ubuntu – Upgraded from 16.04 to 18.04 now curl.so is missing

Apache2curlPHP

I 've upgrade my ubuntu to 18.04 and now I miss my curl.so.

Normally it would be here /usr/lib/php/20160501/curl.so but it is gone.

On the command line I can use curl but not in my php code.

php -m | grep curl leads to

PHP Warning:

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/curl.so' - /usr/lib/php/20160303/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0    

A quick fix would be to just place "a" curl.so in that folder but where do I get a curl.so?

I tried to reinstall it with apt install php-curl but that gives me

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-curl : Depends: php7.2-curl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I'm still using ppa:ondrej/php.

When I check /var/lib/php/7.1/enabled_by_admin curl is listed.

In my /etc/php/7.1/cli/mods_available curl.ini is there.

And in my /etc/php/7.1/cli/conf.d the symlink to that ini is also there.

wget https://curl.haxx.se/download/curl-7.59.0.tar.gz
cd curl-7.59.o
./configure
make
sudo make install

also didn't help.

Best Answer

First I freshly added the ppa and reinstalled php7.1

sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php7.1

Than I installed php7.1-curl and voila all works perfectly fine again.

The problem was that I got old ppa version.

Related Question