404 Not Found nginx/1.22.1 after upgrading my website to PHP 8 in Azure

AKaur 0 Reputation points
2023-06-08T09:13:32.78+00:00

We are getting 404 Not Found nginx/1.22.1 error after update of php version from 7.3 to 8.0 in Azure App services configurations. Please provide solution.

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

1 answer

Sort by: Most helpful
  1. Bryan Trach 17,827 Reputation points Microsoft Employee Moderator
    2023-06-13T00:16:04.94+00:00

    When upgrading the PHP version of your app service, you may need to update the web.config file to ensure that the correct version of PHP is being used. To do this, please see the below steps.

    1. Open the Azure portal and navigate to your app service.
    2. Click on "Configuration" in the left-hand menu.
    3. Scroll down to the "General settings" section and click on "General".
    4. Change the "Stack settings" to "PHP 8.0".
    5. Click on "Save" to apply the changes.
    6. Navigate to the "Advanced tools" section and click on "Go".
    7. Click on "Debug console" and select "CMD".
    8. Navigate to the site directory and open the wwwroot folder.
    9. Locate the web.config file and open it.
    10. Replace the existing <handlers> section with the following:
    <handlers>
      <add name="PHP-FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v8.0\php-cgi.exe" resourceType="Either" />
    </handlers>
    
    
    
    1. Save the changes to the web.config file.
    2. Restart your app service.

    Let me know the outcome of the above steps by replying to this message. We look forward to your reply.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.