Re: PHP sockets enabled but socket_create() gives an error callto undefined function
| From: | rek | Date: | Mon, 01 Nov 2010 17:36:13 +0000 |
| Subject: | Re: PHP sockets enabled but socket_create() gives an error callto undefined function | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309212@lists.php.net to get a copy of this message | ||
I don't think the unix permission will cause a function undefined error.
於 2010年11月02日 01:08, crrrrrrr errrrrrr 提到:
Yes, the http ( Apache user) has rl ( read permission) on the php file with sockets code in it. I think write access is unnecessary for Apache user. On Mon, Nov 1, 2010 at 12:50 PM, Nicholas Kell<nick@monkeyknight.com>wrote:On Nov 1, 2010, at 11:44 AM, crrrrrrr errrrrrr wrote:Yes, the phpinfo() shows that sockets are enabled in both machines. On Mon, Nov 1, 2010 at 12:43 PM, Bastien Koert<phpster@gmail.com>wrote:codeOn Mon, Nov 1, 2010 at 12:40 PM, crrrrrrr errrrrrr<r.suyash@gmail.com> wrote:Hello, I was trying to create a socket connection from a Solaris machine to aRedHat machine to get the PATH in Red Hat machine remotely on Solarismachineand display it to the user. We have a PHP 5.1.6 installation on a Linux server (Apache) and PHP5.2.6.on a Unix(Solaris) server(Apache) . The PHP version on Solaris iscompiledwith --enable sockets and phpinfo() displays that the sockets areenabled.In spite of this we get the following error when using this piece ofnofrom the Solaris machine. The error: PHP Fatal error: Call to undefined function socket_create() in /XXX/ 5server.php<http://cad.njit.edu/u/d/x/dx8/public_html/clunk/swsearch5server.php>on line 21 The code; <?php set_time_limit(0); //ip of the server $addr = 'xxx.xxx.xxx.xxx'; //port of the server $port = 2xxx; //create a socket $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); /* This is linefile.21in the code. i have ommitted a few header comments */ //bind this socket with the above ip and port $ret = socket_bind($sock, $addr, $port); do { $ret = socket_listen($sock, 10); $msgSock = socket_accept($sock); $buf = socket_read($msgSock, 1024); Please let me know if you need any further details I might have missed. Thank you. Suyash Raminenicheck phpinfo() to see if the sockets have been activated in the iniI think that I messed up sending my last email, I apologize. Is the user that Apache is running under configured for the proper read write access to the socket file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- Bastien Cat, the other other white meat