sunilvadranapu Posted April 11, 2007 Share Posted April 11, 2007 any one have worked on creating windows service using PHP. php has win32_service library for creating, deleting .. etc but could any one guide me how to use these library to crate a windows service. thanks in advance SunilKumar V Quote Link to comment https://forums.phpfreaks.com/topic/46567-creating-win32-sercice-in-php/ Share on other sites More sharing options...
sunilvadranapu Posted April 11, 2007 Author Share Posted April 11, 2007 it is very urgent could any one respond to this. Actually i have a php script. I want to run that as a windows service (like a deamon in Linux). I have tried the sample code if ($argv[1] == 'install') { $x = win32_create_service(array( 'service' => 'dummyphp', 'display' => 'sample dummy PHP service', 'params' => __FILE__ . ' 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"); } $x = win32_start_service_ctrl_dispatcher('dummyphp'); while (WIN32_SERVICE_CONTROL_STOP != win32_get_last_control_message()) { usleep(250000); } but i didnt get full idea with this. could any one explain this code? what happens when i install, uninstalll, start the service and stop the service. wht part of code will be executed correspondingly to the above events. with the above code, i am able to create a service but couldnot run it. when i start teh service i am getting error 1053: how to handle start event., stop event how to continuosly check for stop evnt after starting the service please help me to get clear picture on it Thanks in advance -SunilKumar V Quote Link to comment https://forums.phpfreaks.com/topic/46567-creating-win32-sercice-in-php/#findComment-226654 Share on other sites More sharing options...
wildteen88 Posted April 11, 2007 Share Posted April 11, 2007 Urgent requests will not get you anywhere fast. People put their own freee time into this community, they do not get paid so don't expect a radical response. Although our response is usually fast, a reply within the first couple of minutes. However this varies depending on the thread and who's online at the time. Please wait at least 8 - 12 hours before bumping the thread. If you get no replies then more likely no one knows how to answer your question. Quote Link to comment https://forums.phpfreaks.com/topic/46567-creating-win32-sercice-in-php/#findComment-226673 Share on other sites More sharing options...
sunilvadranapu Posted April 11, 2007 Author Share Posted April 11, 2007 ok, thanks for you reply. atlest you mailed something. Actually i have to submit my pjt report in that hurry i mailed like that. As i am in hurry, and waiting for reply from long time(days), i mailed that. Apart from that i know rules of the forum. Quote Link to comment https://forums.phpfreaks.com/topic/46567-creating-win32-sercice-in-php/#findComment-226681 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.