{"id":212,"date":"2022-11-17T22:37:26","date_gmt":"2022-11-17T22:37:26","guid":{"rendered":"https:\/\/blog.bp8.pl\/?p=212"},"modified":"2022-11-17T22:52:15","modified_gmt":"2022-11-17T22:52:15","slug":"azure-app-service-linux-php-8-x-1mb-upload-problem","status":"publish","type":"post","link":"https:\/\/blog.bp8.pl\/index.php\/2022\/11\/17\/azure-app-service-linux-php-8-x-1mb-upload-problem\/","title":{"rendered":"Azure App Service (linux, Nginx), PHP 8.x, 1MB upload problem (WordPress, client_max_body_size)"},"content":{"rendered":"\n<p>Azure App Service for Linux platform now supports PHP 7 and PHP 8 built-in docker image.\u00a0<\/p>\n\n\n\n<p>The issue is that PHP 7.x runs on Apache web server and PHP 8.x run on Nginx server where you cannot server variables via .htaccess<\/p>\n\n\n\n<p>Nginx main configuration is kept in Niginx server{} config we need to change this config and reload Nginx.<\/p>\n\n\n\n<p>We need to copy\u00a0<strong>\/etc\/nginx\/sites-enabled\/default<\/strong>\u00a0to the\u00a0<strong>\/home<\/strong>\u00a0folder. \/home folder is fixed in an Azure Storage file share, files stored there will stay there after restart and will be\u00a0shared across scale instances<\/p>\n\n\n\n<p>Go to:<\/p>\n\n\n\n<p>Go to App Service WEBSSH via\u00a0<strong>https:\/\/&lt;AppServiceName>.scm.azurewebsites.net\/webssh\/host<\/strong> or via UI:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image.png\" alt=\"\" class=\"wp-image-213\" width=\"297\" height=\"204\" srcset=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image.png 594w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-300x206.png 300w\" sizes=\"(max-width: 297px) 100vw, 297px\" \/><\/a><\/figure>\n\n\n\n<p>Copy file: <\/p>\n\n\n\n<p class=\"code-bp8-html\">cp \/etc\/nginx\/sites-enabled\/default \/home\/default<\/p>\n\n\n\n<p>Edit file:<\/p>\n\n\n\n<p class=\"code-bp8-html\">nano \/home\/default<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-1021x1024.png\" alt=\"\" class=\"wp-image-217\" width=\"511\" height=\"512\" srcset=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-1021x1024.png 1021w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-300x300.png 300w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-150x150.png 150w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-768x771.png 768w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1-624x626.png 624w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-1.png 1222w\" sizes=\"(max-width: 511px) 100vw, 511px\" \/><\/a><\/figure>\n\n\n\n<p>Change App Service startup setup to:<\/p>\n\n\n\n<p class=\"code-bp8-html\">cp \/home\/default \/etc\/nginx\/sites-enabled\/default; service nginx restart<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2.png\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-1024x610.png\" alt=\"\" class=\"wp-image-218\" width=\"768\" height=\"458\" srcset=\"https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-1024x610.png 1024w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-300x179.png 300w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-768x457.png 768w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-1536x915.png 1536w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2-624x372.png 624w, https:\/\/blog.bp8.pl\/wp-content\/uploads\/2022\/11\/image-2.png 1736w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/a><\/figure>\n\n\n\n<p>in the same file we can change other Nginx settings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure App Service for Linux platform now supports PHP 7 and PHP 8 built-in docker image.\u00a0 The issue is that PHP 7.x runs on Apache web server and PHP 8.x run on Nginx server where you cannot server variables via .htaccess Nginx main configuration is kept in Niginx server{} config we need to change this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/posts\/212"}],"collection":[{"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":6,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"predecessor-version":[{"id":222,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/posts\/212\/revisions\/222"}],"wp:attachment":[{"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bp8.pl\/index.php\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}