Post by ridax » Mon Jan 24, 2011 8:05 pm

When I checkout from my cart and completed the payment through Paypal (Standard) I should get returned to my web-site to show success-status of payment. But instead I get a fatal error, something like

Fatal error: Call to undefined function file_get_contents_curl() in ....\catalog\controller\payment\pp_standard.php on line 261

If I go to line 498 and make the function file_get_contents_curl private, this error doesn't appear anymore but I am returned to the WEB site as I should.

I have just tested this a few times, so can't say 100% sure if it is consistent.

Another thing I am wondering about is that the php.ini file specifies

allow_url_fopen = on

But even so, the code ends up at line 261 with the file_get_contents_curl instead of 2 lines up with file_get_contents. I haven't checked the code that carefully so don't know, there might be a good reason for that.

Does this make sense, or is everything complete rubbish? In that case, why do I get that fatal error.

New member

Posts

Joined
Sun Jan 23, 2011 4:50 pm


Post by Qphoria » Mon Jan 24, 2011 9:48 pm

file_get_contents() is the preferred way to get data from a url, but for those where allow_url_fopen = off it blows up.
Curl is become more widely used so I added the additional option of file_get_contents_curl() which does the same thing as file_get_contents(), but uses curl instead of fsock.

Even tho the php.ini file has allow_url_fopen = on, it doesn't mean your host allows that setting to be overridden like that so the code sees that disabled.

But there is a bug... that line

Code: Select all

$response = file_get_contents_curl($url . '?' . $request);
should be:

Code: Select all

$response = $this->file_get_contents_curl($url . '?' . $request);

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: Amazon [Bot] and 3 guests