(Docker Solved) Post-processing of the image failed likely because the server is busy or does not have enough resources ERROR
Hi All!
Photo by Markus Spiske on Unsplash |
Post-processing of the image failed likely because the server is busy or does not have enough resources.
Encountered this issue, when uploading media files to my 4nutz.tk website!
To solve this issue it might comes from PHP setting and Nginx settings. Thus i took the chance to fix both!
Fix PHP settings
First i increased the minimum size file upload in PHP settings by introducing new php.ini / uploads.ini file link to local file to the wordpress container
example in docker.yaml file setting.
wordpress:
depends_on:
- db
image: wordpress:5.1.1-fpm-alpine
container_name: anutz_wordpress
restart: unless-stopped
env_file: .env
environment:
- WORDPRESS_DB_HOST=db:3306
- WORDPRESS_DB_USER=$MYSQL_USER
- WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD
- WORDPRESS_DB_NAME=xxx
- WORDPRESS_DB_PORT=3306
volumes:
- ./data/html:/var/www/html
- ./php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
the local file in php/uploads.ini has the following directives.
php/uploads.ini
file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600
which means i increased the memory usage limit to 64 mb and file size also to 64mb, and the max execution time is 600seconds/10minutes by default its only 30seconds.
surprisingly the error still persist then we know that the issue is actually coming from Nginx!
Fix Nginx settings
Reload and Restart Containers
coding for kids Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.
ReplyDelete