Bug #69277 [Fbk->NoF]: PHP-FPM crashes on file_put_contents call

From: Date: Sun, 05 Apr 2015 04:22:20 +0000
Subject: Bug #69277 [Fbk->NoF]: PHP-FPM crashes on file_put_contents call
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191821@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69277&edit=1 ID: 69277 Updated by: php-bugs@lists.php.net Reported by: sebastien dot vray at gmail dot com Summary: PHP-FPM crashes on file_put_contents call -Status: Feedback +Status: No Feedback Type: Bug Package: *Directory/Filesystem functions Operating System: Fedora 21 3.18.3-201.fc21.i686 PHP Version: Irrelevant Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-03-23 06:57:58] laruence@php.net Thank you for this bug report. To properly diagnose the problem, we need a backtrace to see what is happening behind the scenes. To find out how to generate a backtrace, please read http://bugs.php.net/bugs-generating-backtrace.php for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 Once you have generated a backtrace, please submit it to this bug report and change the status back to "Open". Thank you for helping us make PHP better. ------------------------------------------------------------------------ [2015-03-22 17:42:08] sebastien dot vray at gmail dot com Description: ------------ Let's assume the file foo.txt with read only permissions or 744 chmod and the owner of the PHP-FPM process is not the same as foo.txt, if you try to write something in it with the function file_put_contents you'll get a "503 service unavailable" response from apache plus a ambigous warning in the error log: 22-Mar-2015 17:47:27 Europe/Paris] PHP Warning: file_put_contents(foo.txt): °¶»áÈ in /var/www/xxx/api/Library/Log.php on line 121 While using respectively fopen(), fwrite(), and fclose() on the same file with the same conditions and appropriate controls will produce nothing. My PHP version is 5.6.4 Test script: --------------- <?php //foo.txt has 444 chmod or PHP-FPM user doesn't have the appropriate write permissions on the file //This makes PHP-FPM crash file_put_contents('foo.txt', 'Whatever', FILE_APPEND);//Makes PHP-FPM crash //While this doesn't $fpLog = @fopen($path, 'ba+'); if ($fpLog) { @fwrite($fp, $content); @fclose($fpLog); } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69277&edit=1

« previous php.bugs (#191821) next »