Web App PHP Change version

Luis Guevara 60 Reputation points
2023-02-28T21:15:16.65+00:00

Hi,

I have a Web php application in php 7.4 and I try change to php 7.2.

How can do that?

Best regards

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,408 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 19,646 Reputation points Microsoft Employee
    2023-03-01T06:07:45.12+00:00

    @Luis Guevara Thank you for reaching out to Microsoft Q&A.

    Assuming that you are using Azure App service to host your PHP webapp then it is recommended to upgrade the PHP version from 7.4 to PHP>=8.0 versions.

    All the earlier versions of PHP 8.0 are EOL on azure app service as mentioned here which means you your applications will continue to run, however any application hosted in App Service targeting PHP < 8.0 will be out of support and at risk of security vulnerabilities that remain unpatched.

    Note:
    If you are currently targeting Windows for PHP development, we advise to plan for migrating development to target Linux. After November 28 2022, Linux will be the only OS supported by future versions of PHP and continued feature, quality and security updates.

    If you want to update your app to different target versions of PHP using Azure portal, you can refer to the below sequence of steps:

    1. In the Azure portal, click the App Service blade. Select the app you want to update.
    2. In the Configuration panel, click the General settings tab.
    3. Under Stack Settings, click the drop-down menu under Minor version and select the PHP version you want (we recommend choosing the most recent version).
    4. Click Save.

    User's image

    NOTE:

    Changing the stack settings of your app will trigger a re-start of your application.

    Feel free to reach back to me if you have any further questions on this.


1 additional answer

Sort by: Most helpful
  1. Ryan Hill 27,111 Reputation points Microsoft Employee
    2023-03-01T05:20:30.8066667+00:00

    @Luis Guevara to determine available runtimes, you can use the Azure CLI command az webapp list-runtimes --os <host os>. However, PHP 7.x are considered end of life and no longer supported. You will have to use PHP 8.x on a Linux hosted plan.

    To answer your question, though, you can either use the CLI command az webapp update --name <app name> --resource-group <resource-group> --runtime <listed runtime version> or open the app service in the portal, select Configuration blade, then General Settings, and change runtime there.

    User's image

    0 comments No comments