Page 1 of 1

Socket server

Posted: Sun Jun 08, 2008 8:07 pm
by darklord18
Hi everyone! I am new here and to PHP. I have some questions. Try to answer them!!I will be really really grateful! :D

1) I have read that PHP can also act like a socket server(listening to port). I wanted to know how this works? Generally a PHP gets activated when the webpage is opened. How the socket work then?

2) I have read about how to set it up and i am not understanding nothing. It tell me about a script that i must run in the PHP CLI. I am not understanding that! I have seen the command prompt. But how can i configure that in a web host?

3) How do I know if the port has been opened or not.

4) How to configure the socket listening and set up the server.

5) I dont understand the set of instructions that you should put when installing.(to install the socket or SSL support).

here are some phrases that i do not understand how to do it:

"you may need to recompile your PHP binary with the "--enable-sockets" parameter to activate socket support. Windows users get a pre-built binary with their distribution."

" you might prefer to run it from the command line via the PHP binary:

$ /usr/local/bin/php -q server.php

In case you don't have a PHP binary, it's fairly easy to compile one - just follow the installation instructions for compiling a static Apache module (these instructions are available in the PHP distribution), but omit the "--with-apache" parameter to the "configure" script."


Try to answer me these questions!

Thank you a lot!

Hope to hear from you people soon!

Regards,
Naveesh
Doolhur

Re: SOCKET SERVER!!

Posted: Sun Jun 08, 2008 11:10 pm
by Kieran Huggins
Check out http://www.devshed.com/c/a/PHP/Socket-P ... -With-PHP/

You won't likely be able to set up a listening port on a shared webhost though.

Re: Socket server

Posted: Wed Jun 11, 2008 3:26 pm
by darklord18
Thank you a lot!

But when i run the server, the webpage must be running??

can i do this in a dedicated server??

Re: Socket server

Posted: Wed Jun 11, 2008 3:41 pm
by Kieran Huggins

Re: Socket server

Posted: Sun Jun 15, 2008 7:25 am
by darklord18
Thank you a lot for the reply, but how to make it work with windows?

Thank you a lot!