You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
16
17
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.
This guide shows you how to configure your PHP web apps, mobile back ends, and API apps in Azure App Service.
20
21
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.
22
23
23
24
To show the current PHP version, run the following command in the [Cloud Shell](https://shell.azure.com):
24
25
@@ -39,6 +40,10 @@ az webapp list-runtimes --os windows | grep PHP
39
40
40
41
::: zone pivot="platform-linux"
41
42
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
+
42
47
To show the current PHP version, run the following command in the [Cloud Shell](https://shell.azure.com):
43
48
44
49
```azurecli-interactive
@@ -60,20 +65,20 @@ az webapp list-runtimes --os linux | grep PHP
60
65
61
66
::: zone pivot="platform-windows"
62
67
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:
64
69
65
70
```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
67
72
```
68
73
69
74
::: zone-end
70
75
71
76
::: zone pivot="platform-linux"
72
77
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:
74
79
75
80
```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"
> [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).
[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.
2
4
3
5
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:
67
69
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).
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-troubleshoot-monitor.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.
4
4
author: msangapu-msft
5
5
ms.author: msangapu
6
6
ms.topic: tutorial
@@ -9,7 +9,7 @@ ms.date: 06/20/2020
9
9
---
10
10
# Tutorial: Troubleshoot an App Service app with Azure Monitor
11
11
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).
13
13
14
14
[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.
15
15
@@ -26,7 +26,7 @@ You can follow the steps in this tutorial on macOS, Linux, Windows.
@@ -36,13 +36,13 @@ To complete this tutorial, you'll need:
36
36
37
37
## Create Azure resources
38
38
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.
40
40
41
41
```azurecli
42
42
az group create --name myResourceGroup --location "South Central US"
43
43
az webapp deployment user set --user-name <username> --password <password>
44
44
az appservice plan create --name myAppServicePlan --resource-group myResourceGroup --sku B1 --is-linux
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.
59
59
60
60
In this step, you create a Log Analytics workspace to configure Azure Monitor with your app.
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.
97
97
98
98
### Verify the app works
99
99
100
100
To convert images, click `Tools` and select `Convert to PNG`.
101
101
102
102

103
103
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.
105
105
106
106

107
107
108
108
### Break the app
109
109
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.
111
111
112
112

113
113
@@ -165,7 +165,7 @@ AppServiceConsoleLogs |
165
165
where ResultDescription contains "error"
166
166
```
167
167
168
-
In the `ResultDescription` column, you'll see the following error:
168
+
In the `ResultDescription` column, you see the following error:
169
169
170
170
```output
171
171
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.
213
213
imagepng($imgArray[$x], $filename);
214
214
```
215
215
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.
0 commit comments