Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
#23 | remove-curl.patch | 7.73 KB | TR |
Comments
Comment #1
TR CreditAttribution: TR commentedNo, 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.
Comment #2
wxman CreditAttribution: wxman commentedI 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.
Comment #3
rszrama CreditAttribution: rszrama commentedComment #4
wxman CreditAttribution: wxman commentedI 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.
Comment #5
rszrama CreditAttribution: rszrama commentedGlad to hear it. : )
Comment #6
Bao Ha CreditAttribution: Bao Ha commentedFor 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!
Comment #7
wxman CreditAttribution: wxman commentedEasier than what I did.
Comment #8
ReachOut Scott CreditAttribution: ReachOut Scott commentedComment #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
Comment #9
aberg CreditAttribution: aberg commentedI 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.
Comment #10
hedac CreditAttribution: hedac commentedI think cURL dependency should be more clear in the main page of ubercart since most of people are going to use paypal.
Comment #11
rykardo CreditAttribution: rykardo commentedAm 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?
Comment #13
gregoiresan CreditAttribution: gregoiresan commentedGot the same issue... Can I install it on the server if I don't have access to it (share host) ?
Comment #14
longwaveAs 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.
Comment #15
TR CreditAttribution: TR commenteddrupal_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".
Comment #16
mehtab.habib.khan CreditAttribution: mehtab.habib.khan commentedproblem:
PayPal WPP requires the PHP cURL library. (Currently using cURL Not found)
solution:
thats it...
Comment #17
TR CreditAttribution: TR commentedDefinitely 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 ...
Comment #18
longwaveReopening, 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.
Comment #19
longwaveActually, 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.
Comment #20
rajeevkWork like charm..
Thanks,
RajeevK
Comment #21
TR CreditAttribution: TR commentedBumping this forward due to #1862446: Guzzle HTTP client library added to replace drupal_http_request()
Comment #22
TR CreditAttribution: TR commentedNote 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.
Comment #23
TR CreditAttribution: TR commentedHere'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.
Comment #25
longwave23: remove-curl.patch queued for re-testing.
Comment #26
TR CreditAttribution: TR commented23: 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.
Comment #27
TR CreditAttribution: TR commentedCommited 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.
Comment #29
ElZipo CreditAttribution: ElZipo commentedit working in Commerce (Ubuntu):
~#sudo apt-get install php5-curl
~#sudo /etc/init.d/apache2 restart
-> ..../admin/modules enable PayPal WPP
Comment #30
TR CreditAttribution: TR commentedHuh? Your comment has nothing to do with this issue or with Ubercart ...