How to add to PHP.ini on Azure Web Services?
Asked Answered
T

2

10

I'm trying to follow this tutorial: https://www.drupal.org/node/2481341

The second step says:

  1. On global PHP level add curl.cainfo = [enter your path]\cacert.pem to your php.ini.

How would I add this line to my current php.ini file in my Azure App Services?

Tache answered 20/9, 2016 at 18:21 Comment(0)
B
17

Follow these steps in order to change PHP_INI_SYSTEM configuration settings-

  1. Add an App Setting to your Web App with the key PHP_INI_SCAN_DIR and value d:\home\site\ini
  2. Create an settings.ini file using Kudu Console (http://.scm.azurewebsite.net) in the d:\home\site\ini directory.
  3. Add configuration settings to the settings.ini file using the same syntax you would use in a php.ini file. For example, if you wanted to point the curl.cainfo setting to a *.crt file and set 'wincache.maxfilesize' setting to 512K, your settings.ini file would contain this text:

curl.cainfo="%ProgramFiles(x86)%\Git\bin\curl-ca-bundle.crt"

wincache.maxfilesize=512

  1. Restart your Web App to load the changes.

You can refer to the standard document provided by Microsoft from here - https://azure.microsoft.com/en-in/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations

Bria answered 20/9, 2016 at 18:39 Comment(1)
Note: It might be obvious for some, but if you're using a Linux container the path must be /home/site/ini instead of d:\home\site\iniWiltshire
D
7

For Linux, the correct value of PHP_INI_SCAN_DIR should be /usr/local/etc/php/conf.d:/home/site/ini otherwise a lot of default .ini files won't be loaded.

Dichotomy answered 9/11, 2022 at 13:12 Comment(1)
This needs an upvote. From official sourceRechaba

© 2022 - 2024 — McMap. All rights reserved.