Update the version of PHP via the Azure Cloud Shell

Update the version of PHP via the Azure Cloud Shell

In the previous tutorial, you created and configured a WordPress website hosted on Microsoft Azure. In part 2, 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

  1. Sign in to Azure Portal and select the Cloud Shell from the top navigation menu.
    Azure Cloud Shell
  2. 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.
  3. To show the current version of PHP, use the command:
az webapp config show --resource-group  --name  --query phpVersion
  1. 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.

  1. 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
  1. 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.

Next steps

In the following tutorials, you will learn how to connect to your Azure web app via FTP and add a custom domain and an SSL certificate to your website. Stay tuned!

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top