Wednesday, 23 February 2011

php "failed to open stream - no error"

Chased this error (when calling php function file_get_contents) for ages, and eventually spotted: a mal-formed URL: one of the slashes missing after "http:"

Why did it take so long? Because as part of my debugging I echoed the url that I was calling, then copied and pasted that into my browser (Firefox 3.6.13). Result - the page loaded fine.

Good old Firefox had corrected the error without comment.

Moral: sometimes fixing things quietly isn't as kindly an act as one might imagine.

No comments: