Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Allowed memory size exhausted when log directory not writable #1263

Closed
tonivdv opened this issue Dec 18, 2018 · 4 comments
Closed

Comments

@tonivdv
Copy link

tonivdv commented Dec 18, 2018

Hi,

Following got me down the rabbit hole ... I've build a docker image for our php symfony web app in production. While everything worked perfectly in development (same base image), it didn't work in production. Immediately got following error:

[18-Dec-2018 09:09:26] WARNING: [pool www] child 16 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /app/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 107"

Initially I thought it was related to a too low memory settings in php ini file, but after some hours of trial and error I realized I forgot to make the var/log directory writable ...

It seems, when the log directory is not writable a memory leak occurs ...

Not sure if it's an issue in monolog per-se, but I wanted to share this as it could prevent others from wasting time on this.

Cheers

@Seldaek
Copy link
Owner

Seldaek commented Dec 26, 2018

Thanks for sharing but I am not sure what we can do here so closing..

@Seldaek Seldaek closed this as completed Dec 26, 2018
@tonivdv
Copy link
Author

tonivdv commented Dec 26, 2018 via email

@Seldaek
Copy link
Owner

Seldaek commented Dec 26, 2018

We do at https://github.com/Seldaek/monolog/blob/master/src/Monolog/Handler/StreamHandler.php#L107-L110 so I am not sure what issue you encountered.

@tonivdv
Copy link
Author

tonivdv commented Dec 26, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants