You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/configure-language-php.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -348,31 +348,33 @@ As an alternative to using a `.user.ini` file, you can use [`ini_set()`](https:/
348
348
349
349
::: zone pivot="platform-linux"
350
350
351
+
This section applies to directives with a change mode of `PHP_INI_USER`, `PHP_INI_PERDIR`, or `PHP_INI_ALL`. For directives that require change mode `PHP_INI_SYSTEM`, see [Customize PHP_INI_SYSTEM directives](#customize-php_ini_system-directives).
352
+
351
353
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](configure-linux-open-ssh-session.md). First, set up the directory:
352
354
353
355
1. Go to your Kudu site. To get the random hash and region values, in your app **Overview**, copy **Default domain**.
354
356
1. On the top menu, select **Debug console**, then **Bash** or **SSH**.
355
-
1. In Bash or SSH, go to your `/home/site/wwwroot` directory.
357
+
1. In Bash or SSH, go to your `/home/site` directory.
356
358
1. Create a directory called `ini` (for example, `mkdir ini`).
357
359
1. Change the current working directory to the `ini` folder that you created.
358
360
359
361
Next, create an *.ini* file where you add your settings. This example uses `extensions.ini`. There are no file editors such as Vi, Vim, or Nano, so use `Echo` to add the settings to the file. Change the `upload_max_filesize` value from `2M` to `50M`. Use the following command to add the setting and create an `extensions.ini` file if one doesn't already exist:
In the Azure portal, add an application setting to scan the `ini` directory that you just created to apply the change for `upload_max_filesize`:
371
373
372
374
1. Go to the [Azure portal](https://portal.azure.com) and select your App Service Linux PHP application.
373
375
1. Go to **Settings** > **Environment variables**.
374
376
1. Select **+ Add**.
375
-
1. For **Name** enter *PHP_INI_SCAN_DIR* and for **Value**, enter `:/home/site/wwwroot/ini`.
377
+
1. For **Name** enter *PHP_INI_SCAN_DIR* and for **Value**, enter `:/home/site/ini`.
376
378
1. Select **Apply**, then **Apply** again. Confirm your changes.
377
379
378
380
> Make sure to include the colon (:) when appending custom paths to PHP_INI_SCAN_DIR. Omitting it will result in NGINX returning a 404 error.
@@ -403,7 +405,7 @@ For example, to change the value of [`expose_php`](https://php.net/manual/ini.co
403
405
```bash
404
406
cd /home/site
405
407
mkdir ini
406
-
echo"expose_php = Off">> ini/setting.ini
408
+
echo"expose_php = Off">> ini/settings.ini
407
409
```
408
410
409
411
For the changes to take effect, restart the app.
@@ -412,7 +414,9 @@ For the changes to take effect, restart the app.
412
414
413
415
::: zone pivot="platform-linux"
414
416
415
-
To customize `PHP_INI_SYSTEM` directives, you can't use the *.htaccess* approach. App Service provides a separate mechanism that uses the `PHP_INI_SCAN_DIR` app setting.
417
+
This section applies to directives with a change mode of `PHP_INI_SYSTEM`. If your changes don't take effect after following the previous section, verify the directive's [change mode](https://www.php.net/manual/ini.list.php) before proceeding.
418
+
419
+
To customize `PHP_INI_SYSTEM` directives, use the `PHP_INI_SCAN_DIR` app setting.
416
420
417
421
First, run the following command to add an app setting called `PHP_INI_SCAN_DIR`:
418
422
@@ -434,7 +438,7 @@ For example, to change the value of [`expose_php`](https://php.net/manual/ini.co
0 commit comments