Socket server

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
darklord18
Forum Newbie
Posts: 8
Joined: Sun Jun 08, 2008 7:57 pm

Socket server

Post 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
Last edited by Weirdan on Mon Jun 09, 2008 1:58 pm, edited 1 time in total.
Reason: lowercased the title
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: SOCKET SERVER!!

Post 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.
darklord18
Forum Newbie
Posts: 8
Joined: Sun Jun 08, 2008 7:57 pm

Re: Socket server

Post 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??
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: Socket server

Post by Kieran Huggins »

darklord18
Forum Newbie
Posts: 8
Joined: Sun Jun 08, 2008 7:57 pm

Re: Socket server

Post by darklord18 »

Thank you a lot for the reply, but how to make it work with windows?

Thank you a lot!
Post Reply