Strange file() issue

Discussion in 'PHP' started by ScottAN, Apr 1, 2008.

  1. #1
    So I am trying to resolve an issue with my companies server status script that we use to monitor a number of servers. It checks using cron and gets the load averages for each server by using the file() command to access a server side php file that reports the load avg. ANYWAY.. I'm getting this error when accessing ONLY ONE of the servers:

    PHP Warning:  file(http://IPADDRESS:80/server_script.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
    Code (markup):
    Out of ~30 servers only one is causing this error. I've checked the firewall on the server causing the error and thats not the issue. I've flushed DNS on the checking server and the server causing the error. Even stranger, using

    wget http://IPADDRESS:80/server_script.php
    Code (markup):
    through the shell works just fine. Has anyone experienced anything like this??
     
    ScottAN, Apr 1, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Is each server setup exactly the same? Are you getting any specific error? Is it possible that file() is being disabled on the one server that's having problems?
     
    jestep, Apr 1, 2008 IP
  3. ScottAN

    ScottAN Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All servers are set up pretty much the same, yes. I can't think of any settings that would disable only that one command from working for only one server.
     
    ScottAN, Apr 1, 2008 IP
  4. ScottAN

    ScottAN Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Issue is resolved now thanks for the suggestions. It turned out to be a misconfiguration with httpd.conf (a mod_security issue).
     
    ScottAN, Apr 2, 2008 IP
  5. NewTier

    NewTier Notable Member

    Messages:
    2,201
    Likes Received:
    196
    Best Answers:
    0
    Trophy Points:
    250
    #5
    Maybe there's a misconfiguration with your server side, like the httpd.conf module.
     
    NewTier, Apr 2, 2008 IP