The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP error

Discussion in 'General Discussion' started by tris, Aug 6, 2005.

  1. tris

    tris Active Member

    Joined:
    Apr 11, 2003
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Warning: socket_create() Unable to create socket [1]: Operation not permitted in /home/total/public_html/monitor/index.php on line 14

    Warning: socket_set_block() expects parameter 1 to be resource, boolean given in /home/total/public_html/monitor/index.php on line 15

    Warning: socket_set_option() expects parameter 1 to be resource, boolean given in /home/total/public_html/monitor/index.php on line 75
    Cannot connect to http://www.google.com

    www.totalrack.com/monitor

    Anyone have any idea. The other types work but i need icmp for the ping to work.

    Any help would be appreciated.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Did you enable Sockets() when compiling php and do you have all the relevant ports open in your firewall if you have one? Other than that, it's really a programming issue that you'll need to debug.
     
  3. tris

    tris Active Member

    Joined:
    Apr 11, 2003
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    It could be php not compiled with sockets. It isnt calling any ports to begin with, but yes the correct ports are open

    Its not a programming issue though, it works on other servers
     
  4. linux-image

    linux-image Well-Known Member

    Joined:
    Jun 8, 2004
    Messages:
    1,192
    Likes Received:
    1
    Trophy Points:
    38
    Location:
    India
    cPanel Access Level:
    Root Administrator
  5. tris

    tris Active Member

    Joined:
    Apr 11, 2003
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Okay. I checked and PHP is compiled with sockets.

    I also made the file owned by root but still no luck. I still have the error.
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Do you have phpsuexec enabled? If so, you should check the suexec_log and also the main apache error_log for any hints. Other than that, no idea, it's going to be a combination of how you have compiled php, the script and the environment you have configured for it.
     
  7. tris

    tris Active Member

    Joined:
    Apr 11, 2003
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    The script works on anouther cpanel server. The php config is the same and there is nothing in the logs...

    the part of the script which generates the error is

    Code:
    function Net_Ping()
     {
       $this->icmp_socket = socket_create(AF_INET, SOCK_RAW, 1);
       socket_set_block($this->icmp_socket);
     }
    Any further help would be appreciated. I have tried chowning the file as root but nothing seems to work
     
Loading...

Share This Page