About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
powershell_heavy
⚠️
windows_tools
⚠️
missing_linux_example
Summary:
The documentation generally provides parity between Windows and Linux by using platform pivots, but there are several sections where Windows-specific tools, patterns, and instructions are emphasized or provided exclusively. Notably, the 'Run Composer' and 'Run Bower, Gulp, or Grunt' sections are only present for Windows, relying on KuduScript and deployment script customization, with no Linux equivalents or guidance. Some instructions (e.g., changing the site root) use Windows paths and tools first, and Windows-specific details (like .dll extensions, directory structures, and KuduScript) are described in more detail or earlier than their Linux counterparts. In some cases, Linux instructions are less detailed or missing for common tasks.
Recommendations:
- Add Linux equivalents for 'Run Composer', 'Run Bower, Gulp, or Grunt', and custom deployment script automation, including examples of how to achieve similar automation using Oryx hooks or custom scripts.
- Ensure that for every Windows-specific tool or pattern (e.g., KuduScript, .dll, Windows directory paths), a Linux equivalent (.so, Linux paths, SSH/Bash instructions) is provided with equal detail and prominence.
- Where possible, present Windows and Linux instructions side-by-side or in parallel pivots, and avoid placing Windows instructions or tools first unless there is a clear reason.
- Expand the Linux sections to include more detailed, step-by-step guidance for tasks that are described in detail for Windows (e.g., custom deployment automation, enabling extensions, changing site root).
- Review for any missing Linux examples or references, especially for automation and deployment customization, and add them to ensure parity.
Create pull request
Flagged Code Snippets
For the changes to take effect, restart the app.
::: zone-end
## Enable PHP extensions
::: zone pivot="platform-windows"
The built-in PHP installations contain the most commonly used extensions. You can enable more extensions in the same way that you [customize php.ini directives](#customize-php_ini_system-directives).
> [!NOTE]
> The best way to see the PHP version and the current `php.ini` configuration is to call [`phpinfo()`](https://php.net/manual/function.phpinfo.php) in your app.
To enable other extensions, use the following steps:
1. Add a `bin` directory to the root directory of your app, and put the *.dll* extension files in it, for example, `mongodb.dll`. Make sure that the extensions are compatible with the PHP version in Azure, and that they're VC9 and non-thread-safe (NTS) compatible.
1. Deploy your changes.
1. Follow the steps in [Customize PHP_INI_SYSTEM directives](#customize-php_ini_system-directives), and add the extensions into the custom .ini file with the [extension](https://www.php.net/manual/ini.core.php#ini.extension) or [zend_extension](https://www.php.net/manual/ini.core.php#ini.zend-extension) directive:
::: zone-end
## Set the PHP version
::: zone pivot="platform-windows"
To set the PHP version to 8.1, run the following command:
::: zone-end
[!INCLUDE [outdated-runtimes](includes/outdated-runtimes.md)]
::: zone pivot="platform-windows"
## Run Composer
If you want App Service to run [Composer](https://getcomposer.org/) at deployment time, the easiest way is to include Composer in your repository.
From a local terminal window, change the directory to your repository root. Then, follow the instructions at [Download Composer](https://getcomposer.org/download/) to download `composer.phar` to the directory root.
Run the following commands. To run them, you need [npm](https://www.npmjs.com/get-npm) installed.
## Change the site root
::: zone pivot="platform-windows"
The web framework of your choice might use a subdirectory as the site root. For example, [Laravel](https://laravel.com/) uses the `public/` subdirectory as the site root.
To customize the site root, set the virtual application path for the app by using the [`az resource update`](/cli/azure/resource#az-resource-update) command. The following example sets the site root to the `public/` subdirectory in your repository:
By default, Azure App Service points the root virtual application path (`/`) to the root directory of the deployed application files (`sites\wwwroot`).
::: zone-end
::: zone pivot="platform-linux"
The web framework of your choice might use a subdirectory as the site root. For example, [Laravel](https://laravel.com/) uses the `public/` subdirectory as the site root.
The default PHP image for App Service uses NGINX, and you change the site root by [configuring the NGINX server with the `root` directive](https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/). This [example configuration file](https://github.com/Azure-Samples/laravel-tasks/blob/main/default) contains the following snippet that changes the `root` directive:
In the Azure portal, select your app. Under **Development Tools** in the sidebar menu, select **Advanced Tools**, and then go to `d:\home\site` using SSH.
Create a directory in `d:\home\site` called `ini`. Then, create an *.ini* file in the `d:\home\site\ini` directory, for example, `settings.ini`, with the directives that you want to customize. Use the same syntax that you would use in a `php.ini` file.
For example, to change the value of [`expose_php`](https://php.net/manual/ini.core.php#ini.expose-php), run the following commands: