Skip to content

Commit f16b805

Browse files
Merge pull request #312335 from msangapu-msft/main
php updates
2 parents 6a430f2 + b37b32f commit f16b805

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

articles/app-service/configure-language-php.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,31 +348,33 @@ As an alternative to using a `.user.ini` file, you can use [`ini_set()`](https:/
348348

349349
::: zone pivot="platform-linux"
350350

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+
351353
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:
352354

353355
1. Go to your Kudu site. To get the random hash and region values, in your app **Overview**, copy **Default domain**.
354356
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.
356358
1. Create a directory called `ini` (for example, `mkdir ini`).
357359
1. Change the current working directory to the `ini` folder that you created.
358360

359361
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:
360362

361363
```bash
362-
/home/site/wwwroot/ini>echo "upload_max_filesize=50M" >> extensions.ini
363-
/home/site/wwwroot/ini>cat extensions.ini
364+
/home/site/ini>echo "upload_max_filesize=50M" >> extensions.ini
365+
/home/site/ini>cat extensions.ini
364366

365367
upload_max_filesize=50M
366368

367-
/home/site/wwwroot/ini>
369+
/home/site/ini>
368370
```
369371

370372
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`:
371373

372374
1. Go to the [Azure portal](https://portal.azure.com) and select your App Service Linux PHP application.
373375
1. Go to **Settings** > **Environment variables**.
374376
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`.
376378
1. Select **Apply**, then **Apply** again. Confirm your changes.
377379

378380
> 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
403405
```bash
404406
cd /home/site
405407
mkdir ini
406-
echo "expose_php = Off" >> ini/setting.ini
408+
echo "expose_php = Off" >> ini/settings.ini
407409
```
408410

409411
For the changes to take effect, restart the app.
@@ -412,7 +414,9 @@ For the changes to take effect, restart the app.
412414

413415
::: zone pivot="platform-linux"
414416

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.
416420

417421
First, run the following command to add an app setting called `PHP_INI_SCAN_DIR`:
418422

@@ -434,7 +438,7 @@ For example, to change the value of [`expose_php`](https://php.net/manual/ini.co
434438
```bash
435439
cd /home/site
436440
mkdir ini
437-
echo "expose_php = Off" >> ini/setting.ini
441+
echo "expose_php = Off" >> ini/settings.ini
438442
```
439443

440444
For the changes to take effect, restart the app.

0 commit comments

Comments
 (0)