Skip to content

Commit 9703ecd

Browse files
Merge pull request #231456 from msangapu-msft/php
Php
2 parents 5fc0c8b + 0de5207 commit 9703ecd

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ zone_pivot_groups: app-service-platform-windows-linux
1212

1313
# Configure a PHP app for Azure App Service
1414

15-
This guide shows you how to configure your PHP web apps, mobile back ends, and API apps in Azure App Service.
15+
## Show PHP version
16+
::: zone pivot="platform-windows"
1617

17-
This guide provides key concepts and instructions for PHP developers who deploy apps to App Service. If you've never used Azure App Service, follow the [PHP quickstart](quickstart-php.md) and [PHP with MySQL tutorial](tutorial-php-mysql-app.md) first.
18+
[!INCLUDE [php-eol-notice](./includes/php-windows-eol-notice.md)]
1819

19-
## Show PHP version
20+
This guide shows you how to configure your PHP web apps, mobile back ends, and API apps in Azure App Service.
2021

21-
::: zone pivot="platform-windows"
22+
This guide provides key concepts and instructions for PHP developers who deploy apps to App Service. If you've never used Azure App Service, follow the [PHP quickstart](quickstart-php.md) and [PHP with MySQL tutorial](tutorial-php-mysql-app.md) first.
2223

2324
To show the current PHP version, run the following command in the [Cloud Shell](https://shell.azure.com):
2425

@@ -39,6 +40,10 @@ az webapp list-runtimes --os windows | grep PHP
3940

4041
::: zone pivot="platform-linux"
4142

43+
This guide shows you how to configure your PHP web apps, mobile back ends, and API apps in Azure App Service.
44+
45+
This guide provides key concepts and instructions for PHP developers who deploy apps to App Service. If you've never used Azure App Service, follow the [PHP quickstart](quickstart-php.md) and [PHP with MySQL tutorial](tutorial-php-mysql-app.md) first.
46+
4247
To show the current PHP version, run the following command in the [Cloud Shell](https://shell.azure.com):
4348

4449
```azurecli-interactive
@@ -60,20 +65,20 @@ az webapp list-runtimes --os linux | grep PHP
6065

6166
::: zone pivot="platform-windows"
6267

63-
Run the following command in the [Cloud Shell](https://shell.azure.com) to set the PHP version to 7.4:
68+
Run the following command in the [Cloud Shell](https://shell.azure.com) to set the PHP version to 8.1:
6469

6570
```azurecli-interactive
66-
az webapp config set --resource-group <resource-group-name> --name <app-name> --php-version 7.4
71+
az webapp config set --resource-group <resource-group-name> --name <app-name> --php-version 8.1
6772
```
6873

6974
::: zone-end
7075

7176
::: zone pivot="platform-linux"
7277

73-
Run the following command in the [Cloud Shell](https://shell.azure.com) to set the PHP version to 8.0:
78+
Run the following command in the [Cloud Shell](https://shell.azure.com) to set the PHP version to 8.1:
7479

7580
```azurecli-interactive
76-
az webapp config set --resource-group <resource-group-name> --name <app-name> --linux-fx-version "PHP|8.0"
81+
az webapp config set --resource-group <resource-group-name> --name <app-name> --linux-fx-version "PHP|8.1"
7782
```
7883

7984
::: zone-end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
author: msangapu-msft
3+
ms.author: msangapu
4+
ms.topic: include
5+
ms.date: 03/22/2023
6+
---
7+
8+
> [!WARNING]
9+
> [PHP on Windows reached End-of-Life in November 2022 and is only supported on App Service on Linux. This article is for reference only.](https://github.com/Azure/app-service-linux-docs/blob/master/Runtime_Support/php_support.md#end-of-life-for-php-74).
10+
>

articles/app-service/includes/quickstart-php/quickstart-php-windows-pivot.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[!INCLUDE [php-eol-notice](../php-windows-eol-notice.md)]
2+
13
[Azure App Service](../../overview.md) provides a highly scalable, self-patching web hosting service. This quickstart tutorial shows how to deploy a PHP app to Azure App Service on Windows.
24

35
You create the web app using the [Azure CLI](/cli/azure/get-started-with-azure-cli) in Cloud Shell, and you use Git to deploy sample PHP code to the web app.
@@ -67,7 +69,7 @@ To complete this quickstart:
6769
In the following example, replace `<app-name>` with a globally unique app name (valid characters are `a-z`, `0-9`, and `-`). The runtime is set to `PHP|7.4`. To see all supported runtimes, run [`az webapp list-runtimes`](/cli/azure/webapp#az_webapp_list_runtimes).
6870
6971
```azurecli-interactive
70-
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --runtime 'PHP|7.4' --deployment-local-git
72+
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --runtime 'PHP|8.1' --deployment-local-git
7173
```
7274
7375
When the web app has been created, the Azure CLI shows output similar to the following example:

articles/app-service/tutorial-troubleshoot-monitor.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: 'Tutorial: Troubleshoot with Azure Monitor'
3-
description: Learn how Azure Monitor and Log Analytics helps you monitor your App Service web app. Azure Monitor maximizes the availability by delivery a comprehensive solution for monitoring your environments.
3+
description: Learn how Azure Monitor and Log Analytics help you monitor your App Service web app. Azure Monitor maximizes the availability by delivery a comprehensive solution for monitoring your environments.
44
author: msangapu-msft
55
ms.author: msangapu
66
ms.topic: tutorial
@@ -9,7 +9,7 @@ ms.date: 06/20/2020
99
---
1010
# Tutorial: Troubleshoot an App Service app with Azure Monitor
1111

12-
This tutorial shows how to troubleshoot an [App Service](overview.md) app using [Azure Monitor](../azure-monitor/overview.md). The sample app includes code meant to exhaust memory and cause HTTP 500 errors, so you can diagnose and fix the problem using Azure Monitor. When you're finished, you'll have a sample app running on App Service on Linux integrated with [Azure Monitor](../azure-monitor/overview.md).
12+
This tutorial shows how to troubleshoot an [App Service](overview.md) app using [Azure Monitor](../azure-monitor/overview.md). The sample app includes code meant to exhaust memory and cause HTTP 500 errors, so you can diagnose and fix the problem using Azure Monitor. When you're finished, you have a sample app running on App Service on Linux integrated with [Azure Monitor](../azure-monitor/overview.md).
1313

1414
[Azure Monitor](../azure-monitor/overview.md) maximizes the availability and performance of your applications and services by delivering a comprehensive solution for collecting, analyzing, and acting on telemetry from your cloud and on-premises environments.
1515

@@ -26,7 +26,7 @@ You can follow the steps in this tutorial on macOS, Linux, Windows.
2626

2727
## Prerequisites
2828

29-
To complete this tutorial, you'll need:
29+
To complete this tutorial, you need:
3030

3131
- [Azure subscription](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio)
3232

@@ -36,13 +36,13 @@ To complete this tutorial, you'll need:
3636

3737
## Create Azure resources
3838

39-
First, you run several commands locally to setup a sample app to use with this tutorial. The commands create Azure resources, create a deployment user, and deploy the sample app to Azure. You'll be prompted for the password supplied as a part of the creation of the deployment user.
39+
First, you run several commands locally to set up a sample app to use with this tutorial. The commands create Azure resources, create a deployment user, and deploy the sample app to Azure. You're prompted for the password supplied as a part of the creation of the deployment user.
4040

4141
```azurecli
4242
az group create --name myResourceGroup --location "South Central US"
4343
az webapp deployment user set --user-name <username> --password <password>
4444
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku B1 --is-linux
45-
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --runtime "PHP|7.3" --deployment-local-git
45+
az webapp create --resource-group myResourceGroup --plan myAppServicePlan --name <app-name> --runtime "PHP|8.1" --deployment-local-git
4646
az webapp config appsettings set --name <app-name> --resource-group myResourceGroup --settings DEPLOYMENT_BRANCH='main'
4747
git clone https://github.com/Azure-Samples/App-Service-Troubleshoot-Azure-Monitor
4848
cd App-Service-Troubleshoot-Azure-Monitor
@@ -55,7 +55,7 @@ git push azure main
5555

5656
### Create a Log Analytics Workspace
5757

58-
Now that you've deployed the sample app to Azure App Service, you'll configure monitoring capability to troubleshoot the app when problems arise. Azure Monitor stores log data in a Log Analytics workspace. A workspace is a container that includes data and configuration information.
58+
Now that you've deployed the sample app to Azure App Service, you configure monitoring capability to troubleshoot the app when problems arise. Azure Monitor stores log data in a Log Analytics workspace. A workspace is a container that includes data and configuration information.
5959

6060
In this step, you create a Log Analytics workspace to configure Azure Monitor with your app.
6161

@@ -93,21 +93,21 @@ az monitor diagnostic-settings create --resource $resourceID \
9393

9494
Browse to `http://<app-name>.azurewebsites.net`.
9595

96-
The sample app, ImageConverter, converts included images from `JPG` to `PNG`. A bug has been deliberately placed in the code for this tutorial. If you select enough images, the the app produces a HTTP 500 error during image conversion. Imagine this scenario wasn't considered during the development phase. You'll use Azure Monitor to troubleshoot the error.
96+
The sample app, ImageConverter, converts included images from `JPG` to `PNG`. A bug has been deliberately placed in the code for this tutorial. If you select enough images, the app produces an HTTP 500 error during image conversion. Imagine this scenario wasn't considered during the development phase. You'll use Azure Monitor to troubleshoot the error.
9797

9898
### Verify the app works
9999

100100
To convert images, click `Tools` and select `Convert to PNG`.
101101

102102
![Click `Tools` and select `Convert to PNG`](./media/tutorial-azure-monitor/sample-monitor-app-tools-menu.png)
103103

104-
Select the first two images and click `convert`. This will convert successfully.
104+
Select the first two images and click `convert`. This converts successfully.
105105

106106
![Select the first two images](./media/tutorial-azure-monitor/sample-monitor-app-convert-two-images.png)
107107

108108
### Break the app
109109

110-
Now that you've verified the app by converting two images successfully, we'll try to convert the first five images.
110+
Now that you've verified the app by converting two images successfully, we try to convert the first five images.
111111

112112
![Convert first five images](./media/tutorial-azure-monitor/sample-monitor-app-convert-five-images.png)
113113

@@ -165,7 +165,7 @@ AppServiceConsoleLogs |
165165
where ResultDescription contains "error"
166166
```
167167

168-
In the `ResultDescription` column, you'll see the following error:
168+
In the `ResultDescription` column, you see the following error:
169169

170170
```output
171171
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
@@ -213,7 +213,7 @@ In the local directory, open the `process.php` and look at line 20.
213213
imagepng($imgArray[$x], $filename);
214214
```
215215

216-
The first argument, `$imgArray[$x]`, is a variable holding all JPGs (in-memory) needing conversion. However, `imagepng` only needs the image being converted and not all images. Pre-loading images is not necessary and may be causing the memory exhaustion, leading to HTTP 500s. Let's update the code to load images on-demand to see if it resolves the issue. Next, you will improve the code to address the memory problem.
216+
The first argument, `$imgArray[$x]`, is a variable holding all JPGs (in-memory) needing conversion. However, `imagepng` only needs the image being converted and not all images. Pre-loading images is not necessary and may be causing the memory exhaustion, leading to HTTP 500s. Let's update the code to load images on-demand to see if it resolves the issue. Next, you improve the code to address the memory problem.
217217

218218
## Fix the app
219219

0 commit comments

Comments
 (0)