Custom ini directory for App Service Linux RRS feed

  • Question

  • Hi, I want to deploy a Wordpress site on Azure App Service on Linux, the issues is coming when i need to put custom .ini file.

    Read on this URL, i need to put a line on Application Settings with PHP_INI_SCAN_DIR and Linux Directory, apparently it redirect all ini file to the PHP_INI_SCAN_DIR, make it lost all default ini file below.

    I lost the default ini file and turn only custom ini file:

    Anyone know how to put a custom apache/php ini file?

    Tuesday, October 9, 2018 2:09 AM

All replies

  • For PHP enabled through App Settings, we cannot modify php.ini directly. However, we can modify it by using XDT transformation:


    Copy php.ini for the version you are using to D:\home\site


    For ex, when using php 5.6:

    Copy d:\local\Config\PHP-5.6.10\php.ini d:\home\site\php56.ini

    After this add applicationHost.xdt file in D:\home\site folder and add php.ini file.

    For ex. For php 5.6, below is the applicationHost.xdt file:

    <?xml version=”1.0″?>

    <configuration xmlns:xdt=”http://schemas.microsoft.com/XML-Document-Transform”>



          <application fullPath=”D:\Program Files (x86)\PHP\v5.6\php-cgi.exe” xdt:Locator=”Match(fullPath)”>       


                    <environmentVariable name=”PHPRC” xdt:Locator=”Match(name)” value=”d:\home\site\php56.ini” xdt:Transform=”SetAttributes(value)” />







    You can then make changes to your php.ini file and those should take effect.

    Friday, October 12, 2018 5:10 PM
  • Hi Bryan, is it working for App Service in Linux environment?

    Thursday, October 18, 2018 3:58 AM