socket servers binarios em php

eralha

Power Member
Boas pessoal estive a ler este turotrial -> http://devzone.zend.com/node/view/id/1086 acerca de programar socket servers em php, onde encontrei o seguinte problema



In order to run the program, make sure that the first line #!/usr/local/bin/php –q is the location of the PHP CLI (or CGI) binary. You will need to change the mode so it is executable (chmod 755 socket_server.php – where socket_server.php is the name of the file) and run it using ./socket_server.php from the command line.

Now let's look at each line in detail:
  • #!/usr/local/bin/php –q Executes the php CLI binary with the quiet options so it does not print HTTP headers.
  • $sock = socket_create(AF_INET, SOCK_STREAM, 0) – Creates the "master" socket. This socket will not serve the clients, rather it will listen to incoming requests and spawn new sockets for these clients. It acts a master socket "listener".

Bom no icnicio do ficheiro tem um comando: #!/usr/local/bin/php –q
a minha duvida esta em criar o modolo apache para correr o socket server nao estou a perceber onde tenho de executar os comandos.
 
Back
Topo