Kerroy Posted January 26, 2010 Share Posted January 26, 2010 Hello Gurus, I`m trying to take a tcpserver.php file and turn it on as a active service into php. I tried to follow the instruction: 'using the CLI.exe, entering 'q- tcpserver.php' (but it just show the content of the file and nothing else), than using the CMD to enter: php q- tcpserver.php (but all I got is a msg saying that 'q-' is not a valid command (internal or external). I`m using windows xp pro, xampp as a server and php 5.3 installed fresh. Help me, how do I do it? :shrug: Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/ Share on other sites More sharing options...
trq Posted January 27, 2010 Share Posted January 27, 2010 Arguments to commands generally start with -, I believe you are looking for.... php -q tcpserver.php Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002261 Share on other sites More sharing options...
Kerroy Posted January 27, 2010 Author Share Posted January 27, 2010 Thanks thorpe, it`s working great. another question, it`s working only once, how do I keep it live/online? Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002324 Share on other sites More sharing options...
trq Posted January 27, 2010 Share Posted January 27, 2010 You would need to execute the script in the background. Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002340 Share on other sites More sharing options...
Kerroy Posted January 27, 2010 Author Share Posted January 27, 2010 How do I do it? (I`m using xampp as server at the moment and soon it will change to linux server (not sure which yet)) Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002370 Share on other sites More sharing options...
trq Posted January 28, 2010 Share Posted January 28, 2010 On Linux you would likely want to write a startup script and place it within the /etc/init.d directory. php -q tcpserver.php & Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002824 Share on other sites More sharing options...
Kerroy Posted January 28, 2010 Author Share Posted January 28, 2010 I see, and how do I do it in win OS? Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1002908 Share on other sites More sharing options...
oni-kun Posted January 28, 2010 Share Posted January 28, 2010 I see, and how do I do it in win OS? You can only do it with Windows Task Scheduler. Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1003074 Share on other sites More sharing options...
MuseiKaze Posted February 11, 2010 Share Posted February 11, 2010 I believe in linux you can use the chkconfig command to automatically start a service when it boots up. Quote Link to comment https://forums.phpfreaks.com/topic/189857-turning-php-into-a-service/#findComment-1010675 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.