After Ubuntu 18.04 upgrade php7.2-curl cannot be installed After Ubuntu 18.04 upgrade php7.2-curl cannot be installed php php

After Ubuntu 18.04 upgrade php7.2-curl cannot be installed


This can save you:

sudo add-apt-repository ppa:ondrej/phpsudo apt updatesudo apt install php7.2-fpm php7.2-gd php7.2-curl php7.2-mysql php7.2-dev php7.2-cli php7.2-common php7.2-mbstring php7.2-intl php7.2-zip php7.2-bcmath

Then sudo service apache2 restart


You don't need to add a new repo. Just do this and the 7.2 version will be installed. Remember to restart php and apache after. Also make sure (you've prob already done this though) to enable the new mod after:

sudo apt install php-curlsudo a2enmod php7.2

You'll also notice probably that at the end of the install of php-curl (which installs php-curl and php7.2-curl) the following (Note that I have FPM setup, might look different if you're not using FPM):

NOTICE: Not enabling PHP 7.2 FPM by default.NOTICE: To enable PHP 7.2 FPM in Apache2 do:NOTICE: a2enmod proxy_fcgi setenvifNOTICE: a2enconf php7.2-fpmNOTICE: You are seeing this message because you have apache2 package installed.

So do what it says:

sudo a2enmod proxy_fcgi setenvifsudo a2enconf php7.2-fpmsudo systemctl restart apache2.service


Installing libcurl4 worked for me using

apt install libcurl4

Then installed php7.2-curl, restarted apache2 without an issue.