error_log gets bloated with entries: PHP Warning: fgets() expects parameter 1 to be resource, boolean given

Created:

2017-03-02 10:11:29 UTC

Modified:

2017-08-08 13:25:23 UTC

1

Was this article helpful?


Have more questions?

Submit a request

error_log gets bloated with entries: PHP Warning: fgets() expects parameter 1 to be resource, boolean given

Applicable to:

  • Plesk for Linux

Symptoms

/var/log/php/error.log gets bloated with the following entries:

WARNING: [pool example.com] child 11403 said into stderr: "NOTICE: PHP message: PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /var/www/vhosts/example.com/httpdocs/index.php on line 104"
WARNING: [pool example.com] child 30121 said into stderr: "NOTICE: PHP message: PHP Warning:  feof() expects parameter 1 to be resource, boolean given in /var/www/vhosts/example.com/httpdocs/index.php on line 103"

Cause

Errors in the code of the application.

Resolution

Contact the developer of the application to correct the code.

Function fopen() returns value 'false' when fails to open a file. This is treated as inappropriate type of data for functions feof() and fgets() . This produces the warnings that get registered in the error log file.

Have more questions? Submit a request
Please sign in to leave a comment.