I see a post as below with the similar requirement and solution
Increase Max Upload Size on Azure App Service PHP8
I'm trying to upload larger files to a PHP 8 app running on Azure App Service.
The instructions in the Microsoft Documentation for Azure App Service are referencing PHP 7 which used Apache, rather than the PHP 8 instances which use NGINX so they don't work.
I have tried adding client_max_body_size 100M; to the sites-available/default config file and restarted NGINX but no luck in getting it to work. The test file is 11MB, smaller files of 1MB work fine.
6 answers
Sort by: Most helpful
-
-
Grmacjon-MSFT 18,456 Reputation points
2023-08-18T20:03:23.0533333+00:00 Hi @Daryl Peter I wanted to inform you that the Azure App Service documentation PHP 8 has been updated. Below is how you can upload files in PHP8:
To customize PHP_INI_USER, PHP_INI_PERDIR, and PHP_INI_ALL directives for linux web apps, such as upload_max_filesize and expose_php, use a custom "ini" file. You can create it in an SSH session.
- Go to your KUDU site https://<sitename>.scm.azurewebsites.net.
- Select Bash or SSH from the top menu.
- In Bash/SSH, go to your "/home/site/wwwroot" directory.
- Create a directory called "ini" (for example, mkdir ini).
- Change the current working directory to the "ini" folder you just created.
You need to create an "ini" file to add your settings to. In this example, we use "extensions.ini." There are no file editors such as Vi, Vim, or Nano so you'll use echo to add the settings to the file. Change the "upload_max_filesize" from 2M to 50M. Use the following command to add the setting and create an "extensions.ini" file if one doesn't already exist.
/home/site/wwwroot/ini>echo "upload_max_filesize=50M" >> extensions.ini /home/site/wwwroot/ini>cat extensions.ini upload_max_filesize=50M /home/site/wwwroot/ini>
Then, go to the Azure portal and add an Application Setting to scan the "ini" directory that you just created to apply the change for upload_max_filesize.
- Go to the Azure portal and select your App Service Linux PHP application.
- Select Application Settings for the app.
- Under the Application settings section, select + Add new setting.
- For the App Setting Name, enter "PHP_INI_SCAN_DIR" and for value, enter "/home/site/wwwroot/ini."
- Select the save button.
Hope that helps.
-Grace
-
John M 0 Reputation points
2024-07-03T07:41:32.7733333+00:00 This is insanity. Wordpress is useless if you can only upload a 50mb database. This is a really basic setting that Microsoft is making very difficult. There is no information anywhere. I spent 16hrs trying to figure this out and am still at square 1. Does anyone have any sort of work around? I am simply trying to migrate a site over with a database that is 1.5gb.
-
Nicolas Mikellides (CTC ITEC) 20 Reputation points
2024-08-20T13:36:09.53+00:00 Was this ever resolved ? I currently have issues with most of my sites hosted on Azure!! I have followed recomdation from @Grmacjon-MSFT above but that does not work
-
Bogdan Berg 0 Reputation points
2024-11-07T04:01:22.6133333+00:00 I'm facing the same problem, trying 1 solution at a time from every thread I can find online, still no success and am stuck at the 50MB limit.
Puzzling, how such basic functionality/configuration requirement can become so obfuscated in Azure...