Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure App Service Linux provides PHP images with preconfigured settings and extensions. If you need to adjust your PHP settings, follow the steps provided below.
Updating PHP Settings-
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.
NOTE: If you already have an extensions.ini file, you can use the same command which will add the new setting to the file.
/home/site/ini>echo "upload_max_filesize=50M" >> extensions.ini /home/site/ini>cat extensions.ini upload_max_filesize=50M /home/site/ini>
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.
upload_max_filesize=50M
c) 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.
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.
Testing-
1. You should now see the upload_max_filesize increase from 2M to 50M if you have a PHP info page. If not, create one by going to your /home/site/wwwroot directory and perform the following.
echo "<?php phpinfo();" >> info.php
2. You should now see the values by going to https://<sitename>.azurewebsites.net/info.php
Please sign in to use this experience.
Sign in