Azure / wordpress-linux-appservice

MIT License
96 stars 65 forks source link

Increase file upload size limit to >256MB? #155

Open victorlin opened 4 days ago

victorlin commented 4 days ago

I am trying to upload a 4.4GB backup file for the All-in-One WP Migration plugin. I noticed the upload size limit is configurable by UPLOAD_MAX_FILESIZE but capped by POST_MAX_SIZE's maximum of 256MB. Is there any way to increase this even more, or is it a limitation of the architecture?

Relevant document: wordpress_application_settings.md

victorlin commented 3 days ago

I was able to do this by creating a new file /home/site/ini/custom.ini:

upload_max_filesize=512M
post_max_size=512M

and configure it to be used by setting the PHP_INI_SCAN_DIR environment variable:

https://github.com/Azure/wordpress-linux-appservice/blob/b23b80df28d368f323167d432454ba711a84dc87/WordPress/wordpress_adding_php_extensions.md?plain=1#L49

It seems to work well with the higher limit. Not sure why UPLOAD_MAX_FILESIZE/POST_MAX_SIZE are capped to 256M.

Reference: Increase Max Upload Size on Azure App Service PHP8 - Microsoft Q&A