Skip to content

Commit

Permalink
Update wordpress-upload-limits.md (#22)
Browse files Browse the repository at this point in the history
Improve grammar and add a section to deal with 502 errors on admin-ajax.php call.s
  • Loading branch information
petarmihaylov authored Aug 9, 2024
1 parent 6913df0 commit b8b957a
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions content/guides/wordpress-upload-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ video: ''

<you-tube video="rxQMMvvsNS8"></you-tube>

PHP has a 2mb upload limit. This is often not enough for some things you want to do with WordPress and may inhibit plugin installation.
To change this, you'll need to make configuration updates to both PHP and NGINX.
PHP has a `2mb` upload limit. This is often insufficient for some things you want to do with WordPress and may inhibit plugin installation.
To change this, you must make configuration updates to both PHP and NGINX.

<base-info>
This is often a standard task for WordPress sites. However, these instructions also apply for any PHP app where you might need
This is often a standard task for WordPress sites. However, these instructions also apply to any PHP app where you might need
to modify file upload limits.
</base-info>

## PHP configurations

In the server > services > PHP settings section (click the wrench icon), you can increase the upload limits, you will likely want
In the server > services > PHP settings section (click the wrench icon), you can increase the upload limits, and you will likely want
to increase the max_input_time, upload_max_filesize, and memory_limit variables.

Such as:
Expand All @@ -34,6 +34,29 @@ After updating PHP, go back to the services section and select the wrench icon f
2. Save file
3. Restart nginx by clicking on the restart icon

This then should allow you to upload larger file sizes to your WordPress site. If you are curious as to if the configs
were updated and to what other configs you might want to alter for your WordPress site, Wordpress has a section that displays
This should allow you to upload larger file sizes to your WordPress site. If you are curious whether the configs
were updated and what other configs you might want to alter for your WordPress site. WordPress has a section that displays
current configs located in the `WordPress admin dashboard > tools > site health > info > server tab.`

## 502 Errors When Calling `wp-admin/admin-ajax.php`

Some themes and plugins rely heavily on AJAX requests, which can sometimes cause `502` errors when `wp-admin/admin-ajax.php` is called. To attempt to fix this, add the following into the `http` section of your `/etc/nginx/nginx.conf`.

1. Navigate to Server > [The server you want to update] > Services > Nginx.
2. Click the three dots on the far right and open the menu.
3. Select `Edit nginx.conf`
4. In the `http` section, add:
```
##
# FastCGI Settings
##
fastcgi_temp_file_write_size 10m;
fastcgi_busy_buffers_size 512k;
fastcgi_buffer_size 512k;
fastcgi_buffers 16 512k;
```
5. Click `Update`
6. Click the three dots on the far right to reopen the Nginx menu.
7. Select `Restart`.

Once you reload the page generating the error and try again, you should not see the `502` error.

0 comments on commit b8b957a

Please sign in to comment.