The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 2 of 2

Thread: socket_connect: permission denied

  1. #1

    socket_connect: permission denied

    I have a socket listener up and running (it's from the flash/php tutorial on this site), which works fine with flash.

    I have a test file:

    PHP Code:
    ("/SERVER test message");
    serverMessage($buf) {
    DEBUG_HASH) { logDebug("entering function <b>serverMessage</b> in sockTest.php: buf: [$buf]"); }
    $ip "myIP"// my real IP is in the file
    $port myPort// my real port is in the file
    $socket socket_create(AF_INETSOCK_STREAMSOL_TCP);
    DEBUG_HASH) { logDebug("socket: [$socket]"); }
    DEBUG_HASH) { logDebug("results: [" socket_strerror(socket_last_error()) . "]"); }
    $results socket_write($socket$buf);
    DEBUG_HASH) { logDebug("results: [" socket_strerror(socket_last_error()) . "]"); }
    DEBUG_HASH) { logDebug("exiting function serverMessage"); }
    When I run it from shell, it parses the message and outputs to proper text to connected users.

    When I call this function from within a php file that runs as a web page
    PHP Code:
    serverMessage("/SERVER test message"); 
    I get the following error log (bolded red is the permission issue):

    2007-01-04 23:26:26 -- entering function serverMessage in sockTest.php: buf: [/SERVER test message]
    2007-01-04 23:26:26 -- socket: [Resource id #42]
    2007-01-04 23:26:26 -- results: [Permission denied]
    2007-01-04 23:26:26 -- results: [Broken pipe]
    2007-01-04 23:26:26 -- exiting function serverMessage

    Any ideas why I can't connect from within the web based PHP script but I Can when connected to shell? Looks like some sort of perm issue, but many searches on google turned up no data I found to help resolve this issue.

    Help !

  2. #2
    HA! After hours of searching, I finally found the culprit in SELinux. A couple minor tweaks resolved the problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012