c0nfus3d1 Posted September 1, 2012 Share Posted September 1, 2012 Not sure if this is the right place to ask, but I'm trying to develop a few PHP "bots." Everything works great if I call the script like: php ./myscript.php but as soon as I close the terminal, the script stops processing. I then try: php ./myscript.php & hoping it will run in the background. I get a process ID number, but nothing usually happens when I go this route. Is there any way I can actually set my script to run in the background, without needing to keep a terminal open? Quote Link to comment https://forums.phpfreaks.com/topic/267903-php-cli/ Share on other sites More sharing options...
Christian F. Posted September 1, 2012 Share Posted September 1, 2012 I could simply say "Yes", and have answered your question perfectly. Seeing as it's a "yes" or "no" question. Though, I'll be nice and add "by using & as you have" to the answer. In other words: Yes, what you have done should work. If you want more specific answers, you have to provide more information. Such as the code you're trying to run, what you mean with "nothing happens" (getting a PID is something happening, btw), and anything else that you think might be relevant to the problem at hand. Also, I strongly recommend that you read this article. Quote Link to comment https://forums.phpfreaks.com/topic/267903-php-cli/#findComment-1374565 Share on other sites More sharing options...
c0nfus3d1 Posted September 2, 2012 Author Share Posted September 2, 2012 Unless you're actually going to help or post anything useful, why bother posting at all? Unless you're trolling. I do not believe this the place to troll. This is, in fact, a place where people CAN go and ask questions. I mean, unless I misread the description of this forum: "Do you need help with some code you wrote? Ask here! We'll get you the answers!" You know, the "ask here" part kind of makes it seem like I CAN ASK A QUESTION. As opposed to this like you've provided that states "Don't ask us questions" First of all, I assumed that what I had done was correct. Since nothing was happening, I was trying to quadruple check my thought. By simply verifying that it should have worked, you actually have helped. All the rest of your post? Useless. If it is your habit of proving useless information, please do not bother in responding to any further posts I make. I prefer to talk to people who are actually willing to discuss the topic, not just post useless crap trying to make themselves look like they know more about the topic than they really do. You don't have to impress me, I promise. If you don't know the answer, just say I don't know- or don't reply at all! Just sayin.. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/267903-php-cli/#findComment-1374582 Share on other sites More sharing options...
darkfreaks Posted September 2, 2012 Share Posted September 2, 2012 Forum Do's 1.) Do Try to find your own answers. 2.) Do try to be respectful & courteous of other members 3.)Do try suggestions that are provided Quote Link to comment https://forums.phpfreaks.com/topic/267903-php-cli/#findComment-1374598 Share on other sites More sharing options...
jazzman1 Posted September 2, 2012 Share Posted September 2, 2012 Is it a windows or Linux machine? Quote Link to comment https://forums.phpfreaks.com/topic/267903-php-cli/#findComment-1374618 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.