roundcube / roundcubemail-docker

Resources to build Docker images for Roundcube Webmail
290 stars 129 forks source link

PHP in container throwing "Allowed memory size ... exhausted" error. #125

Closed DArqueBishop closed 3 years ago

DArqueBishop commented 3 years ago

I'm running the latest container on two separate Linode instances, one with 2 GB memory and the other with 16 GB memory.

On both, I get a blank screen when connecting to Roundcube. In the docker logs, I get the following error:

PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /var/roundcube/config/config.docker.inc.php on line 9

I have added a link to the zzz_roundcube-custom.ini file, with memory_limit=512M. The same error occurs:

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 12288 bytes) in /var/roundcube/config/config.docker.inc.php on line 16

I run the container using the following command line:

docker run -v /usr/local/etc/roundcube/config:/var/roundcube/config -v /usr/local/etc/roundcube/config:/var/www/html/config -v /usr/local/etc/roundcube/php/zzz_roundcube-custom.ini:/usr/local/etc/php/conf.d/zzz_roundcube-custom.ini -p 127.0.0.1:8080:80 --restart always --name roundcube -d roundcube/roundcubemail

Both systems are running CentOS 7.9 and are fully patched. I cannot tell you when it started; it was only reported to me today.

thomascube commented 3 years ago

You're mapping the same host filesystem path (/usr/local/etc/roundcube/config) to two different volumes (/var/roundcube/config and /var/www/html/config). This leads to an infinite loop of config file inclusions until PHP memory is full. Please remove the volume mapping for /var/www/html/config and you should be fine.