go to bug id or search bugs for
Can no longer output to STDERR using file_put_contents. Used to work fine in PHP 5.x.
Also Affects 7.1.x
$msg = "Error Occurred\n";
Error Occurred written to console on stderr
Rather than stderr output error message, I get a warning:
Only 0 of 15 bytes written, possibly out of free diskspace in script.php on line 3
Add a Patch
Add a Pull Request
This problem only seems to be a problem when using php-cgi
Thanks for the report. I see this when running your snippet
$ php-cgi.exe bug76086.php 1>nul
How exactly teh issue can be reproduced?
I only get the error when running via fast-cgi. I am not sure how to reproduce this without running a webserver.
Ok, I have found the bug more specifically.
You will need the cgi-fcgi command util from ubuntu/debian package: libfcgi0ldbl
Run fcgi server in dir with bugs76086.php script
PHP_FCGI_CHILDREN=1 php-cgi -b 127.0.0.1:9000
Then send a request from cli:
SCRIPT_NAME=bug76086.php SCRIPT_FILENAME=bug76086.php REQUEST_METHOD=GET cgi-fcgi -bind -connect 127.0.0.1:9000
returns (from cgi-fci command, not terminal running php-cgi):
PHP Warning: file_put_contents(): Only 0 of 2 bytes written, possibly out of free disk space in C:\Users\chris\bug76086.php on line 5
Thanks for the further info. libfcgi0ldbl is not a package from the PHP distribution. It is also unlikely available on Windows. Thus, seems it's not a PHP bug. From what is shown, i guess it's about the port doesn't get reused or similar. If there's a repro regarding PHP, please post, otherwise it's probably to be marked as not a bug.
I am ONLY using the libfcgi0ldbl as a stand-in for running a webserver.
It fails exactly the same way using Apache with fastcgi, nginx with fastacgi and using a PHP fastcgi client. If you prefer I can write an example that uses the fcgi client used by the php unit tests.
using the cgi-fcgi package just means the example is simple to try and run and with Bash for windows, its easy enough to run it on windows too.
I can't reproduce this on Linux, so this looks Windows-specific.
> If you prefer I can write an example that uses the fcgi client
> used by the php unit tests.
That would be great, since we prefer to have a PHPT regression
test to go along with the actual bug fix, anyway.