When I try to activate Paypal payments, it fails with:
PayPal WPP requires the PHP cURL library. (Currently using cURL Not found)
I'm running on a Linux Ubuntu server I made myself, and I know that cURL is installed:

curl 7.18.0 (x86_64-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Any ideas how to get around this. I really need to get Paypal working.

CommentFileSizeAuthor
#23 remove-curl.patch7.73 KBTR
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TR’s picture

No, you do not have the "PHP cURL library" installed. That error message contains a link - if you click on a link it takes you to the page at php.net which explains exactly what you have to do to install PHP cURL.

wxman’s picture

I already did try that, but something seems to be wrong with the install for Ubuntu apt-get install php5-curl. It comes back with all kinds of warnings. I have to figure out what's going on there.

rszrama’s picture

Status: Active » Closed (won't fix)
wxman’s picture

I was finally able to fix this. It ended up that I accidentally installed the wrong version of one of the php libraries. The only way to fix it was to uninstall php5-common, which was what got installed by mistake, and all associated with it. Then I reinstalled all the php5 files over again from the correct sources. Now it all works.

rszrama’s picture

Glad to hear it. : )

Bao Ha’s picture

For debian, and probably the same for Ubuntu, you would need to reconfigure php5-curl:

#dpkg-reconfigure php5-curl

Then, restart the web server:

#/etc/init.d/apache2 restart

It fixed my problem!

wxman’s picture

Easier than what I did.

ReachOut Scott’s picture

Comment #6 does appear to be the fix for this problem. The issue has been reported as a bug in Ubuntu.

As a workaround, simply type the following at a command prompt:
#sudo dpkg-reconfigure php5-curl
#sudo /etc/init.d/apache2 restart

You can follow updates to this issue in Launchpad at Bug #428650.

https://bugs.launchpad.net/ubuntu/+source/php5/+bug/428650

aberg’s picture

I had the same problem, but was unable to run 'dpkg-reconfigure php5-curl' because I did not have the package installed. However, activating the module directly in the database seems to also work.

I changed the database and modified the table 'system'. Here I activated the paypal module by changing 'status' to '1' for 'uc_paypal'
UPDATE system SET status=1 WHERE name='uc_paypal';

I am not sure if there are any after effects for this, but it seems to work. I tried payments using the paypal sandbox and live, and it worked without problems.

update:
After checking some more I found that I was wrong and this does not work on a clean install. The site that did work had some extra modules installed, among these were uc_views and uc_advanced_catalog. Installing these modules and duplicating the settings took away the need for curl (which I could not install), but for sure this is not the best way to solve things.

hedac’s picture

I think cURL dependency should be more clear in the main page of ubercart since most of people are going to use paypal.

rykardo’s picture

Am experiencing similar problem here and am not good with programming or understanding how to go about getting curl....i dont seem to understand the installation/configuration guidlines on php.net

* Authorize.net requires the PHP cURL library. (Currently using cURL Not found)
* Cybersource's Silent Order POST requires the PHP cURL library. (Currently using cURL Not found)
* PayPal WPP requires the PHP cURL library. (Currently using cURL Not found)

Please can anyone help me with relevant information on how to solve this problem?

gregoiresan’s picture

Got the same issue... Can I install it on the server if I don't have access to it (share host) ?

longwave’s picture

Title: Can't activate Paypal payment missing cURL » Replace cURL usage with drupal_http_request
Category: support » task
Status: Closed (won't fix) » Active

As this issue has been bumped several times even though it's closed, I am reopening and retitling it; it should be possible to use drupal_http_request() on all servers, instead of cURL which is not available on all PHP environments.

TR’s picture

drupal_http_request() is a dysfunctional function - it has known problems dating back 7+ years. I presume this is why a lot of modules use cURL - I know that's why *I* use cURL in some of *my* modules. In particular, for my Canada Post module, the Canada Post web server doesn't support HTTP 1.0 requests which is all drupal_http_request() can do even though HTTP 1.1 has been available for 11+ years! (I can't type enough exclamation points here to emphasize how incredible that is ...) Relying on cURL, which is actively developed by a much wider user base than just the Drupal community, and which is frequently updated, seems like a good decision as opposed to the ad hoc re-inventing of the wheel through drupal_http_request().

I think it's sufficient to put the cURL test in hook_requirements() as is currently done. A webhost which doesn't or won't support cURL or OpenSSL (implicitly required for drupal_http_request() in order to use the HTTPS protocol) or increased PHP memory limits etc. is just not suitable for running an Ubercart store. IMO of course. I prefer to move this back to "won't fix".

mehtab.habib.khan’s picture

problem:
PayPal WPP requires the PHP cURL library. (Currently using cURL Not found)

solution:

  1. open php.ini
  2. search for extension=php_curl.dll
  3. remove the ; in start of line
  4. save and close php.ini
  5. restart WAMP

thats it...

TR’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Active » Closed (won't fix)

Definitely not going to happen in 6.x-2.x.

Drupal 8.x will be getting rid of drupal_http_request() entirely.

So the only remaining question is should this be done in Ubercart 7.x-3.x. My answer is that it certainly won't be done before 7.x-3.0 is released - messing around with something fundamental this late in the release cycle is a very bad idea. If someone wants to work on this AFTER 3.0 is released, then feel free to re-open this issue if you can provide a patch AND TESTS for the PayPal module to make sure everything works. But as I said in #15, I don't think it's worth the effort to replace a piece of code that works perfectly well (cURL) with one that has many known problems (drupal_http_request()). If you don't have or can't get cURL then you have bigger things to worry about than this ...

longwave’s picture

Status: Closed (won't fix) » Active

Reopening, as things have changed in the past year; D8 will be keeping drupal_http_request() and we should offload our requests to it, see #1479190: Certificates on https requests to payment processors are not getting verified for more details.

longwave’s picture

Status: Active » Postponed

Actually, this should be postponed until #1081192: Verify peer on HTTPS if cURL available (but be careful of built-in cert bundles in the codebase) gets into core, otherwise we are just removing the certificate verification we added in #1479190: Certificates on https requests to payment processors are not getting verified.

rajeevk’s picture

Work like charm..

Thanks,
RajeevK

TR’s picture

Title: Replace cURL usage with drupal_http_request » Replace cURL usage with Guzzle
Version: 7.x-3.x-dev » 8.x-4.x-dev
Issue summary: View changes
Status: Postponed » Active
TR’s picture

Assigned: Unassigned » TR

Note that in Drupal 8:
- Drupal 8 *core* requires (and uses) cURL, so Drupal will no longer run without cURL.
- drupal_http_request() is gone entirely.
- Guzzle is the recommended substitute for drupal_http_request(), although direct cURL usage is accepted in D8.

I have already converted all our drupal_http_request() calls into Guzzle for D8. I'm now working on replacing all our explicit cURL calls with Guzzle for D8 because I think a mix of Guzzle/cURL is less maintainable.

Given that going forward D8 requires cURL, I see no need to eliminate cURL usage in D7 Ubercart.

TR’s picture

Status: Active » Needs review
FileSize
7.73 KB

Here's a patch to do this. I'm 99% sure it works, but I can't test it as I don't have accounts with the three payment processors and besides there are other payment issues that prevent this code from running at the moment. This is definitely a place we should use mock responses for testing.

Status: Needs review » Needs work

The last submitted patch, 23: remove-curl.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review

23: remove-curl.patch queued for re-testing.

TR’s picture

23: remove-curl.patch queued for re-testing.

I plan to just commit this patch if the tests still pass - we can always go back and clean up any problems that may arise later on.

TR’s picture

Status: Needs review » Fixed

Commited 1eed2c51eaf

As this issue has taken a lot of turns, and the code is now totally different than it used to be, please open a NEW issue if you find a problem related to this patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ElZipo’s picture

it working in Commerce (Ubuntu):
~#sudo apt-get install php5-curl
~#sudo /etc/init.d/apache2 restart
-> ..../admin/modules enable PayPal WPP

TR’s picture

Huh? Your comment has nothing to do with this issue or with Ubercart ...