Home > OS >  Run HTML as PHP in PHP8 on Azure App Service Linux Not Working
Run HTML as PHP in PHP8 on Azure App Service Linux Not Working

Time:10-11

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?

CodePudding user response:

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.

  • Related