400 bad request - local copy fails, remote works
Posted by: darkroomsource (---.ptldor.dsl-w.verizon.net)
Date: August 30, 2009 03:32AM

Sorry if this has already been covered, can't find search function, so I waded through several hundred messages and did not see it.

I am getting the following error when I try to open a URL on a remote server

Warning: fopen(ht tp://www.hughescomputerconsulting.com/database/show.php?type=comment&realm=darkroomsource&pageid=/Darkroom Source/index.shtml) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in C:\wamp\www\Darkroom Source\hcc-comments.php on line 21


code is real simple:
$s="ht tp://www.hughescomputerconsulting.com/database/show.php?type=comment&realm=darkroomsource&pageid=/Darkroom Source/index.shtml";
$fd = fopen($s, "r"winking smiley;

Note: the space between ht and tp does not really exist in the code or the error message, I put it there so that you can see it without having the bulletin board software turn it into a link.

phpinfo() shows:
allow_url_fopen On On

when I run this EXACT SAME CODE from a remote server, it has no problem, only when I run the local version through WAMP.

I know it has to be something I've done wrong in the configuration of my local WAMP server, but I can't find any information anywhere about how to solve this issue.

Thanks for your time, at least looking at this.
Andy Hughes


BTW, I absolutely LOVE WAMPserver. I've never had an easier install for anything this complicated before, and I am extremely impressed with the professionalism displayed throughout the product.

Options: ReplyQuote


Sorry, only registered users may post in this forum.