Page 1 of 1

PHP TCP Listener

Posted: Fri Apr 17, 2009 11:06 am
by farzadrocks
Hello All,
I have created a client/server application with PHP where the server is the PHP code
that opens a TCP socket and gets a XML package --> extract some information from it
and update MySQL database ...
Client is an 8-bit PIC micro-controller that is capable of receiving some sensor information ...
create a XML packet and send it to my PHP code...
so the database contains sensor information ...
now people can go to a web-page and see the value of the sensor

===
currently I start my php script manually but I want when the computer starts to do it for me automatically ...

Do you think that PHP is the appropriate language for creating a TCP listener ?
If so,
Could I make the php code to run as windows service ? (I run windows @ this moment)
If that is the case
+
How would I check to see MySQL service is started prior to my script ...
Thanks a lot in advance

Re: PHP TCP Listener

Posted: Fri Apr 17, 2009 7:04 pm
by farzadrocks
I actually found the way to do this :
http://ca3.php.net/manual/en/win32servi ... ervice.php
you could run a php script as a windows service
Also you could check the status of other services
http://ca3.php.net/manual/en/function.w ... status.php
this is part of win32service
http://ca3.php.net/manual/en/book.win32service.php