You will learn how to show and update the PHP version using the Azure Cloud Shell.
To complete the exercise, you will need:
- An Azure subscription.
- A WordPress website running on Azure.
What is PHP?
PHP is a widely-used open source scripting language that can be used to create interactive websites. PHP is especially suited for web development and can be embedded into HTML.
WordPress is written using PHP as the scripting language. Many WordPress users may see the “WordPress PHP Update Required” notification in their dashboard. In order to see all the recommendations from WordPress, navigate to Tools > Site Health.
Show PHP version
- Sign in to Azure Portal and select the Cloud Shell from the top navigation menu.
- If this is the first launch of Cloud Shell, you should first choose your preferred shell experience and create a storage account.
- Select PowerShell
- Then select a subscription, a region and create a new resource group (or use an existing one), storage account and Microsoft Azure Files share.
- Click Create storage.
- To show the current version of PHP, use the command:
az webapp config show --resource-group --name --query phpVersion
- You can also see the supported PHP versions using the following command:
az webapp list-runtimes | grep php
Update PHP version
Keeping PHP up-to-date is important since your website will be faster and more secure.
- The latest supported PHP version is 7.4. In Azure Cloud Shell, use the following command to update the version of PHP to 7.4:
az webapp config set --name --resource-group --php-version 7.4
- Sign in to your website to confirm the changes.
If you want to learn more about how to configure your PHP web apps, you can read the article Configure a PHP app for Azure App Service on Microsoft Docs.