Note that official support for PHP 8 will only be available on Linux, as a result of this App Service
will only support PHP 8 on Apps Service Linux instances
. For additional information on this topic: PHP on App Service, php.internals: Microsoft Support of PHP on Windows.
This article will demonstrate on how to use PHP 8 for App Service Windows, since there would be no official support from Microsoft for it, please use at your own risk.
Generally, we are following this post: How to use a Custom PHP runtime for App Service Windows - (azureossd.github.io) to download a custom PHP runtime and map Handler for it.
1. Create a new Web app for Windows using any available Runtime stack for Windows.
2. After the creation complete, go to Kudu site from Azure Portal:
3. Create a new directory and download the PHP runtime(Non Thread Safe Version) from PHP For Windows: Binaries and sources Releases and extract it, in this demo, we use php 8.2.1(it has been deprecated, use 8.2.9 as of Aug 11 2023), the output is as below:
mkdir php
curl https://windows.php.net/downloads/releases/php-8.2.1-nts-Win32-vs16-x64.zip -o php\php.zip
cd php
unzip php.zip
4. Go to Path mappings in configuration. Add a new handler mapping. The extension is "*.php", the Script processor is "C:\home\php\php-cgi.exe". Then save it. All the configuration is done.
5. To verify it, we can create an "index.php" file under C:\home\site\wwwroot with below content. The result would look like as below:
<?
phpinfo();
I hope you enjoy it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.