linux - No stdout when php process is spawned in the background

818

I'm having issues writing to file on one of my servers(rhel6) from php, i don't seem to get any stdout when i start it as a background process.

  • php x.php > x.log - works just fine
  • php x.php > x.log & - outputfile created but is empty

  • echo asd > x.log & - produce an outputfile

x.php:

<?php
  echo 'asd';

This issue only affect one out of the three servers i've tried this on, the php version is 5.3.3 on the affected server(rhel6), and the other two servers(rhel7 / centos7) run php version 5.4.16.

Further testing : fwrite from php would not create the file when its launched in the background given full path, doing it in the foreground will gives the expected results.

People are also looking for solutions to the problem: php - How To configure Language menu in Typo3 CMS

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.