App Service PHP8.0 Wordpress PHP configuration?

CheeseAndOnionScone 96 Reputation points
2021-11-25T05:36:56.367+00:00

With the update to PHP8.0, it has not changed to NGINX

How do we modify the php file so that we can increase the file upload limit please for wordpress?

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,333 questions
No comments
{count} votes

Accepted answer
  1. CheeseAndOnionScone 96 Reputation points
    2021-11-25T19:47:42.587+00:00

    Hello,

    I managed to figure it out in case anyone else needs. If you put a .user.ini into the root, it will pick it up

    Can we please update the documentation here - https://learn.microsoft.com/bs-latn-ba/azure/app-service/configure-language-php?pivots=platform-linux#how-to-change-the-built-in-php-configurations

    It looks like the move to NGINX is awesome and fast, but none of this was documented that this was happening when you switch PHP versions.


1 additional answer

Sort by: Most helpful
  1. ajkuma 13,456 Reputation points Microsoft Employee
    2021-11-25T11:36:20.543+00:00

    @CheeseAndOnionScone , Thanks for the great question.

    Yes. Azure App Service on Linux images using PHP 8.x are now bundled with NGINX instead of Apache. The use of .htaccess files will not work for NGINX as these are used for Apache only. You could setup a custom startup script and modify the existing NGINX site configuration.

    Also, since PHP 8 images are defaulted to nginx/php-fpm . So, you will not need .htaccess, but can use rewrite rules to mimic .htaccess.

    Kindly take a look at the sample: URL below for post_max_size=60M and | upload_max_filesize=20M
    https://github.com/Azure-App-Service/nginx-fpm/blob/master/php.ini

    Also, checkout the App Service article, for modifying the default site config, and for steps to create the custom startup script and the application settings:
    App Service PHP -8 Rewrite-rule

    Additionally: please checkout these docs:

    You may take a look at this third party blog to know - Convert Apache Rewrite Rules to NGINX Rewrite Rules | NGINX

    You can configure using startup command.
    Azure App Service on Linux FAQ | What-are-the-expected-values-for-the-startup-file-section-when-i-configure-the-runtime-stack-

    Kindly let us know how it goes or you have any further questions.

    No comments