Date: June 8th, 2004
Cate: Geekism
Tags:

fsockopen and PHP 4.3.4?

So is fsockopen just completely hosed in PHP 4.3.4 or what? I have a friend who was happily using FoF for a while, then it stopped working. His host is running PHP 4.3.4, and I suspect they just recently upgraded, and I think that broke fsockopen (which Snoopy uses (which Magpie uses (which FoF uses))). I’ve searched and found some bug reports on fsockopen in 4.3.4, but not quite with the same symptoms. Here’s what I’m seeing:

  • fsockopen to ‘127.0.0.1′ or ‘localhost’: works!
  • fopen to an http URL on another host: works!
  • fsockopen to another host, by name or by IP: fails! No error message is printed or logged. In fact, the script dies so completely that the browser gives a “This document contains no data” error. If you telnet in and type the HTTP request yourself, the server closes the connection before sending back any headers or anything.

At first I thought maybe his host had disabled fsockopen or maybe banned connections to other hosts. But fsockopen is not disabled, it works when connecting to localhost, and fopen works when connecting to any host.

Is this this bug? The symptoms aren’t quite the same. Is there any hope? Any workaround? Or should I just advise him to ask his host to upgrade to 4.3.5?

2 Comments

  1. ScasquiovScasquiov  
    December 26th, 2005
    REPLY))

  2. I got this same behaviour when using feedwordpress (which also uses magpie). I haven’t found any other reference to this issue though other than the url you posted.
    PHP’s version is also 4.3.4, i’ll update it and see that solves it. thanks!

    1F

  3. GeorgeGeorge  
    August 30th, 2006
    REPLY))

  4. Did you check your firewall settings? Looks like outgoing connections aren’t allowed.

    2F

Leave a Reply

 Name

 Mail

 Home

[Name and Mail is required. Mail won't be published.]