question

AhmedAliAssistantDirectorIT-2629 avatar image
AhmedAliAssistantDirectorIT-2629 asked ·

Changing the configuration file php.ini in Bitnami Wordpress

There are some limitations in Bitnami wordpress. we want to change the limit of file upload size but cant find any option. please guide us in this regard

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
ajkuma-MSFT answered ·

@AhmedAliAssistantDirectorIT-2629, Welcome to Microsoft Q&A! Thanks for posting the question.

Firstly, you can accomplish this by updating PHP settings via Kudu and adding an Application Setting to scan the “ini”, to apply the change for upload_max_filesize

Updating PHP Settings

Yes. Settings such as upload_max_filesize, expose_php, and others can be modified using a custom “ini” file. You can use either SSH or Bash to accomplish this.

  1. Go to your KUDU site https://<sitename>.scm.azurewebsites.net

  2. Select Bash or SSH from the top menu.

  3. In Bash/SSH, go to your “/home/site” directory.

  4. Create a directory called “ini” (i.e. mkdir ini)

  5. Change directories to “ini”.

  6. We’ll need to create an “ini” file to add our settings to. In this example, I’m using “extensions.ini”. There are no file editors such as Vi, Vim, or Nano so we’ll simply use echo to add the settings to the file. I’m changing the “upload_max_filesize” from 2M to 50M. Below is the command that I used to add the setting and create an “extensions.ini” file if one doesn’t already exist.


Note: If you already have an extensions.ini file, you can use the same command which will add the new setting to the file.

8256-kudu-php-config.jpg

  1. If using SSH, you can use vi to create/edit the extensions file using the following commands.
    a) vi extensions.ini
    b) Press “i” on your keyboard to start editing and add the following.

  2. upload_max_filesize=50M

  3. Press “Esc”, then “:wq!” and enter to save.


Add an Application Setting

We’ll now need to go to the Azure Portal and add an Application Setting to scan the “ini” directory that we just created to apply the change for upload_max_filesize.

  1. Go to the Azure Portal (https://portal.azure.com) and select your App Service Linux PHP application.

  2. Select Application Settings for the app.

  3. Under the Application settings section, press the “+ Add new setting”.

  4. For the App Setting Name, enter “PHP_INI_SCAN_DIR”.

  5. For the value, enter “/usr/local/etc/php/conf.d:/home/site/ini”

Note: If you’re you’ve recompiled a PHP extension such as GD, perform the steps at “Recompiling PHP Extensions” at Azure App Service - Adding PHP Extensions and enter a value of “/home/site/ini” and omit the “/usr/local/etc/php/conf.d:” portion.

  1. The first portion of the value is the location of other ini files that come with the Docker container and the second part (after the “:”) is the directory that contains our new ini file.

  2. Press the save button.

Hope this helps! If you need more information on this - please checkout this document or let us know, we would be more than happy to assist.


kudu-php-config.jpg (26.6 KiB)
Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.