curl or fsockopen for paypal ipn

爷,独闯天下 提交于 2019-12-24 01:33:09

问题


What advantages does one have over the other? Paypal recommends using fsockopen however there are many scripts on the internet which use curl.

Which one shall I use?

Curl: http://www.namepros.com/code/306043-process-paypal-ipn-with-curl.html

fsockopen: https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation


回答1:


I don't really think it matters one way or another, except that in certain Apache2 installs there could be either availability issues (Curl is not installed) or OpenSSL double initialization problems (Curl's SSL initialization fails because OpenSSL has already initialized).

Recent Apache/PHP setups solved this issue but for a good little while the default Apache2/PHP/Curl installs on Debian wouldn't work properly, and the PHP streams options (fsockopen, file_get_contents`) would always work, so I think that the docs (updated in July 2010, if the date on the doc is right, which means it was written even earlier) may just be trying to keep it simple.



来源:https://stackoverflow.com/questions/7379428/curl-or-fsockopen-for-paypal-ipn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!