permission denied error in php socket programming
hi friends,
1. I hv done a simple client application in php to send "hello world" to the port 1234 in 127.0.0.1 (localhost).
(google in net for php client program)
2. opened terminal and
$nc -l 1234
so that whatever comes in port 1234 i will get it from the terminal.
1. socket successfully created.
2. Attempting to connect to '127.0.0.1' on port '1234'...socket_connect() failed. Reason: () Permission denied
3. if i run in terminal,
$php client.php
No issues, it is communicating.
if i access the same with browser (firefox) it is giving problem.
Error in :
echo "Attempting to connect to '$address' on port '$port'...";
$result = socket_connect($socket, $address, $port);
if ($result === false) {
echo "socket_connect() failed.\nReason: ($result) ";
echo "\n". socket_strerror(socket_last_error($socket)) . "\n";
} else {
echo "successfully connected to $address.\n";
}
can some one help me to resolve the issue
Last edited by jayasekar; 01-21-2010 at 05:33 AM.
|