FIREBALL5 Posted September 27, 2008 Share Posted September 27, 2008 Hi, I am trying to create sockets, and I am getting "Permission denied". I know I have the right address and port no., but it's not even willing to bind the sockets. $addr = "69.36.243.188"; //$addr = "www.freechess.org"; $port = 23; $mysocket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); if ($mysocket === false) exit(socket_strerror(socket_last_error($mysocket))); // Gives me: Permission denied Quote Link to comment Share on other sites More sharing options...
FIREBALL5 Posted September 27, 2008 Author Share Posted September 27, 2008 Actually, that one doesn't give me the error, it's socket_bind. $bind = socket_bind($mysocket,$addr,$port); if ($bind === false) exit(socket_strerror(socket_last_error($mysocket))); Quote Link to comment Share on other sites More sharing options...
FIREBALL5 Posted September 28, 2008 Author Share Posted September 28, 2008 *bump* Quote Link to comment Share on other sites More sharing options...
corbin Posted September 28, 2008 Share Posted September 28, 2008 If it's running under linux, you might not have permission to create a socket on port 23. Ports <= 1024 are root only. Quote Link to comment Share on other sites More sharing options...
FIREBALL5 Posted September 28, 2008 Author Share Posted September 28, 2008 well, would it work with port 5000, the other port available for this website? Quote Link to comment Share on other sites More sharing options...
FIREBALL5 Posted September 28, 2008 Author Share Posted September 28, 2008 *bump* Quote Link to comment Share on other sites More sharing options...
DarkWater Posted September 28, 2008 Share Posted September 28, 2008 I don't know, why don't you try it...? Quote Link to comment Share on other sites More sharing options...
FIREBALL5 Posted September 28, 2008 Author Share Posted September 28, 2008 I did try port 5000. ALERT: Apparently the host didn't allow socket connections, so this was why the permission was denied. As for my syntax, I'm not sure, but it was my host that was disallowing the sockets, not the code. I am going to mark this case as solved. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.