0

I need to parse HTML through PHP. This works fine on PHP 7.4 with the following added to the .htaccess file:

AddType application/x-httpd-php .html .htm

However as soon as I upgrade to PHP 8 on the app service, the code is displayed rather than parsed. I have tried the below, suggested in another post, which returns NULL:

<?php echo $_SERVER['REDIRECT_HANDLER']; ?>

Any suggestions?

Matt Doble
  • 195
  • 2
  • 12

1 Answers1

1

That is because Azure App Service for PHP 8 no longer uses Apache but Nginx. This is related to the question "How to Deploy an App Service in azure with Laravel 8 and PHP 8 without public endpoint?".

As I mentioned there I will mention here too: I've written a full blog article about my first experiences with PHP 8 on Azure App Services which includes the issue you mention here.

Have a look at it and let me know if it solved your struggles.

DragonBe
  • 426
  • 2
  • 6
  • Thank you for this. Where are you initially placing the config file to be copied in your startup command? The root home folder? Can all of the schema you can add within an Nginx config file go into this custom file? – Matt Doble Oct 10 '21 at 20:08