Jump to content

How to use PHP8 for App Service Windows


Recommended Posts

Guest KevinLi
Posted

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.

 

largevv2px999.png.00bbb17edba2ee61ef4cb4578f868a32.png

 

 

 

2. After the creation complete, go to Kudu site from Azure Portal:

 

largevv2px999.png.7f6f1bb9c35122dac0029fcdfb6afce5.png

 

 

 

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, 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

 

 

 

 

 

largevv2px999.png.f0993f6534673fac65354bb1746620b4.png

 

mediumvv2px400.png.1b820e775265546827febcab3cdf3f32.png

 

 

 

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.

 

largevv2px999.png.686b506510fbe091c9a534c7628692c1.png

 

 

 

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();

 

 

 

 

 

largevv2px999.png.8199a472057123ba586257e092635540.png

 

 

 

I hope you enjoy it.

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...