PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1845
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
PHP TCP listener Posted by TNT123 on 17 Apr 2009 at 4:35 PM
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 ...
so how would I do this ?
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
Report
Re: PHP TCP listener Posted by TNT123 on 17 Apr 2009 at 5:08 PM
I actually found the way to do this :
http://ca3.php.net/manual/en/win32service.examples-service.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.win32-query-service-status.php
this is part of win32service
http://ca3.php.net/manual/en/book.win32service.php



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.