I am not able to run php file in background on my servers. When I am running php test.php, it answers or even php test.php > anser.txt also works. However when I am running the same php file in background i.e php test.php > answer.txt & it fails.
-
It kills the answer.txt & there is not output in the file. Please help me out to run the same. However I am using an work around method for the same i.e php test.php < /dev/null > answer.txt &. This works.
-
Answer:
you have to run it in nohup. So in your example the command would be: nohup php test.php > answer.txt The PHP CLI works different than when it is being used by a webserver.
Nick Funnell at Quora Visit the source
Related Q & A:
- How do i change my display name when i answer a question?Best solution by Yahoo! Answers
- Why do I pee a little when I sneeze, even though I'm not pregnant?Best solution by answers.yahoo.com
- Why does Yahoo now sign me into chat even when I say No thanks?Best solution by Yahoo! Answers
- Always feel hungry even when I'm not?Best solution by Yahoo! Answers
- How do I remove my name from my email so it does not show up when I send mail?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.