logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP 7.4 error with php://stderr
Author
mpiche



Joined: 10 Apr 2008
Posts: 9

PostPosted: Thu 23 Jan '20 19:05    Post subject: PHP 7.4 error with php://stderr Reply with quote

Since PHP 7.4, the stream php://stderr is giving me a PHP notice "Bad file descriptor".

Everything is working fine with PHP 7.3. If i switch to mod_apache I don't have the notice. Also, the notice isn't happening if I run my script directly from the command line.

My script is :
$fp = fopen('php://stderr', 'w');
fwrite($fp, "test\n");

The result is :
Notice: fwrite(): write of 5 bytes failed with errno=9 Bad file descriptor in D:\htdocs\test_code\74.php on line 18

Thanks,
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 24 Jan '20 11:02    Post subject: Reply with quote

Congratulations you found a bug in PHP 7.4!

Code:

error_reporting(E_ALL);
ini_set('display_errors','On');
$fp = fopen('php://stderr', 'w+');
var_dump($fp);
fwrite($fp, "test\n");


the var_dump shows that it is a valid stream.
Back to top
mpiche



Joined: 10 Apr 2008
Posts: 9

PostPosted: Fri 24 Jan '20 15:52    Post subject: Reply with quote

Thanks ! I have send a bug report on php website.
Back to top


Reply to topic   Topic: PHP 7.4 error with php://stderr View previous topic :: View next topic
Post new topic   Forum Index -> Other Software