sunilvadranapu Posted April 5, 2007 Share Posted April 5, 2007 Hi, Can any one help me on how to create a web service in PHP? i have a php script which i want to run as a windows service. Please give me steps on how to create a windows service and ref links. plase give me example if possible. Thanks in advance SunilKumar Link to comment https://forums.phpfreaks.com/topic/45725-how-to-create-a-windows-service-in-php/ Share on other sites More sharing options...
utexas_pjm Posted April 5, 2007 Share Posted April 5, 2007 A Windows service and a web service are two entirely different things. You seem to be using them interchangably, could you clarify? Patrick Link to comment https://forums.phpfreaks.com/topic/45725-how-to-create-a-windows-service-in-php/#findComment-222121 Share on other sites More sharing options...
sunilvadranapu Posted April 5, 2007 Author Share Posted April 5, 2007 My script need to be run when i START windows service from SCM(service Control Mangaer). Like a deamon in Linux. I want proceduer for creating a windows service. Actually i created the windows service using win32_create_service(). But when i start the windows service Status was not changed in SCM. Hot to change the status using win32_set_service_status(). I have created a windows service as <?php if ($argv[1] == 'install') { $x = win32_create_service(array( 'service' => 'dummyphp', 'display' => 'PHPservice', 'path' => 'C:\php\php.exe', 'params' => 'C:\trickle.php source=/sdfs601/tetools/xmlloader/xmlcentral instance=demo dbname=sateesh dbuser=sateesh dbpass=sateesh keepfiles=true logging=hour debug=true' . ' run', )); debug_zval_dump($x); exit; } else if ($argv[1] == 'uninstall') { $x = win32_delete_service('dummyphp'); debug_zval_dump($x); exit; } else if ($argv[1] != 'run') { //die("bogus args"); } if (!win32_start_service_ctrl_dispatcher('dummyphp')) { die("I'm probably not running under the service control manager"); } else echo "Registered with SCM"; while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) { usleep(250000); } ?> where to write the code to chnage the status to START in SCM?? Thanks SunilKumar Link to comment https://forums.phpfreaks.com/topic/45725-how-to-create-a-windows-service-in-php/#findComment-222124 Share on other sites More sharing options...
sunilvadranapu Posted April 10, 2007 Author Share Posted April 10, 2007 Hi, any help regarding how to create a windows service in PHP? help in this regard. give example flow for createing windows service. Link to comment https://forums.phpfreaks.com/topic/45725-how-to-create-a-windows-service-in-php/#findComment-225606 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.