Paypal not work 3.1.2

Hi
I enabled PayPal. Then I went to the address (Applications - PayPal Developer) and get Client ID and Secret added it to the website. When author want pay Article Processing Charge, see white page
image
Please help me

Hi @Adminojs,

Check your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi
See php error log

[29-Aug-2019 16:42:42 ] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home2/grcom/domains/gr.com/public_ht
ml/plugins/paymethod/paypal/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 238

Hi @Adminojs,

OJS is probably unable to reach out to the Paypal service. Is your server proxied or firewalled?

Regards,
Alec Smecher
Public Knowledge Project Team

Regardless, the server hosting your service is also in Datacenter France, so there should be no problem accessing PayPal server location.
If there is a restriction on the server the answer is no, but if there is a problem, please send us the exact error.
The weird thing we noticed was that if we run a bug on the program and point out errors or warnings to a specific file, a file with a volume of over 800MB will be created when calling this link. Noteworthy

Hi @Adminojs,

The error message suggests that Guzzle (a third party library that’s included as part of the Paypal plugin) took longer than 30 seconds to communicate during a Paypal transaction. I doubt it would legitimately take more than that to process a transaction with the Paypal server, so I suspect there was a network timeout or something similar in the process.

Regards,
Alec Smecher
Public Knowledge Project Team

No specific logs are logged on the server side when running this script
. How to debug a program step by step to see where you are stopping and what the problem is
Please check the following log

The first log is related to executing the link in question

176.9.140.133 - - [29/Aug/2019:21:36:34 +0430] "GET /index.php/GJASR/payment/pay/6 HTTP/1.1" 499 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"

And this link is also the result

176.9.140.133 - - [29/Aug/2019:21:41:45 +0430] "GET /index.php/GJASR/payment/pay/6 HTTP/1.1" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"

Please note the server response time and link callback, the server returned 500 response after 5 minutes
That is not a 500 response from the server either because there is nothing logged in the web service error log and this is from your application.

Hi @Adminojs,

A 500 error in OJS should always correspond with an entry in the PHP error log. The one you quoted above:

[29-Aug-2019 16:42:42 ] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home2/g***rcom/domains/g***r.com/public_ht
ml/plugins/paymethod/paypal/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 238

…says that there’s a 30-second time limit set up in your PHP configuration, so I’m not sure how a script could run for 5 minutes before timing out. (Did you extend the time limit in the PHP configuration?)

If you want to step through the script, the code responsible for handling "GET /index.php/GJASR/payment/pay/6 HTTP/1.1" is in the pay function in pages/payment/PaymentHandler.inc.php. From there it goes into the payment form, which in the case of Paypal is implemented in plugins/paymethod/paypal/PaypalPaymentForm.inc.php.

Regards,
Alec Smecher
Public Knowledge Project Team

Function curl_multi_init Disabled by server due to security. What are alternative methods or functions?

Hi @Adminojs,

OJS uses the Omnipay payment processing library, which in turn uses Guzzle, which in turn uses curl_multi_init. If you want to avoid the use of curl_multi_init you’d need to change the upstream libraries (most probably Guzzle) to avoid it. I think your best bet will be to get your host to enable that function.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
As a web-hosting company, we have blocked curl_muli_* function to prevent compromised websites from doing ddos attacks, And also given the intense sensitivity of the datacenters to the attacks, so these functions are disabled in PHP, the host said, using the Alternate curl function or fsockopen to create the connection.
Thanks

Hi @Adminojs,

I looked into this a little further. The issue you’re describing is resolved in this change to the Guzzle library (again, this is third-party code used by the Omnipay library, also third-party code).

However, upgrading our toolset to include the version of Guzzle that includes this fix will mean requiring at least PHP 7.1. The current release of OJS 3.1.2 sets PHP 7.0 as the required minimum and the new toolset will not run on that.

Our general policy is to make sure that OJS will run on all currently-maintained versions of PHP. I see that PHP 7.0 is no longer officially supported so I’ve opened an issue to review and possibly bump our PHP requirements accordingly.

Whether the next 3.1.2 release includes the newer Guzzle will depend on how disruptive the changes to upstream libraries are. If they are not disruptive, then the next 3.1.2 release should include this; if they are disruptive, then it’ll have to wait until OJS/OMP 3.2 (currently planned for January 2020).

Regards,
Alec Smecher
Public Knowledge Project Team