bitcodr
bitcodr

Reputation: 1454

PHP5-Curl install error no installation candidate

I want to install PHP5-Curl in my Debian server. But when I run this command:

apt-get install PHP5-Curl

I got an error like:

Reading package lists... Done
Building dependency tree
Reading state information... Done

Package PHP5-Curl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'PHP5-Curl' has no installation candidate

Upvotes: 10

Views: 24031

Answers (4)

Biswadp
Biswadp

Reputation: 21

First search for your php version using command php -v and then download the respective version of php(version)-curl.

Upvotes: 1

bogtan
bogtan

Reputation: 847

Try searching for the available version that suits for you with sudo apt-cache search curl | grep php and then sudo apt-get install php<x>-curl.

In my case it was php7.0-curl.

Upvotes: 12

Benjamin Gakami
Benjamin Gakami

Reputation: 1759

Use sudo apt-get install php5.6-curl

Upvotes: 15

Will
Will

Reputation: 24739

It looks like you have multiple, conflicting versions of PHP installed. First, let's clean up. Back up your configuration files first, as this will remove them.

dpkg --purge --force-all php5-curl
apt-get remove php5-*
apt-get purge php5-*
apt-get autoremove

Now, run dpkg -l | grep php5 again, and make sure that no php5-... packages are installed.

Then, let's start fresh:

apt-get install php5-cli php5-curl

If you need the Apache module:

apt-get install libapache2-mod-php5

Or if you need the FPM module:

apt-get install php5-fpm

Upvotes: -5

Related Questions