Docker How-to: Increase Maximum Upload File Size
There are many tools that enable you to set up local development environments for creating and testing WordPress websites. MAMP is one of them, and it'due south remarkably piece of cake to use.
Even so, if you want to get the most out of it, you'll need to increase its default upload size.
Since WordPress is congenital on PHP, the software's settings can make up one's mind how well your website operates. For example, using an outdated version of PHP can prevent yous from running the latest WordPress releases. On the same note, having a low memory limit tin can crusade frequent errors.
In this commodity, nosotros'll introduce you to MAMP, explain why it'south a smart idea to increase the upload size, then prove y'all how to do information technology in two elementary steps. Let'due south get started!
An Introduction to MAMP
MAMP is a tool that lets you set upwards a local server surroundings on your macOS or Windows computer. With it, yous can install the following software on your computer:
- Apache
- Nginx
- PHP
- MySQL
In that location are enough of other tools that you can use to install WordPress locally. Notwithstanding, we similar MAMP because it provides y'all with an intuitive control panel and the option to switch between Nginx and Apache for your web server software:
The instructions yous'll find below apply whether yous're using the costless version of MAMP or MAMP PRO. You can apply either version to install WordPress locally.
Why Increment Your Web Server'due south PHP Upload Size
Every PHP installation uses a set of variables or "directives" that govern its settings. These are the three settings that determine how PHP deals with file uploads (every bit far equally size is concerned):
-
memory_limit
: This determines how much memory your server tin allocate to each PHP script. -
post_max_size
: This setting controls the maximum size ofMail service
information that your server will allow and plays a role in WordPress file uploads. -
upload_max_filesize
: The value that you set hither determines the file size limit for uploads to your website.
Every bit we mentioned, WordPress is congenital on PHP. Therefore, all of these settings direct bear on your website. If your PHP installation has a depression retentiveness limit, you'll meet problems uploading files and executing scripts on your site.
At that place's no ideal PHP retentiveness limit that suits every web server. Nonetheless, since we're talking near a local development environment, you have full liberty over how many resource to allocate to your setup. Whereas most spider web hosts volition cap your PHP memory limit (within reason), there's no forced cap with your local instance.
Some tutorials tell you to only increase the upload_max_filesize
setting within your PHP configuration. Withal, that can atomic number 82 to errors. The PHP documentation is clear when information technology indicates that your post_max_size
setting should accept a higher value than upload_max_filesize
.
Likewise, memory_limit
should have a higher value than post_max_size
. As long as your PHP settings adhere to those guidelines, you should be aureate.
How To Increase the Upload Size for Your Local MAMP Web Server (in 2 Steps)
For this tutorial, we'll evidence you how to configure MAMP to increase its upload size on both Windows and macOS. Nosotros'll likewise use the MAMP control console to ensure that you updated your server settings successfully.
Step ane: Modify Your php.ini File
Modifying your PHP settings in MAMP is easy. To do so, yous'll need to edit your MAMP installation's php.ini file.
You lot can access that file in 1 of these two locations, depending on whether you're using Windows or macOS:
- Windows: C:/MAMP/conf/phpx.x.x/php.ini
- macOS: /Applications/MAMP/bin/php/phpx.x.ten/conf/php.ini
If you navigate to the conf directory, you'll notice that it includes several folders for different PHP versions. By default, your MAMP installation should use the latest PHP version, and you'll desire to access the folder that corresponds to it.
To double-bank check which version of PHP you're using, open the MAMP control panel, get to MAMP > Preferences > PHP, so look at the version number next to "Standard Version":
Subscribe Now
Adjacent, you tin return to the conf directory and access the folder that correlates to that version. Inside, you lot'll find a lone php.ini file. Go ahead and open up it using your favorite text editor, and you lot'll see something similar this:
As we explained in the last section, you need to look for the following 3 directives:
-
memory_limit
-
post_max_size
-
upload_max_filesize
We recommend setting a memory limit of 128 or 256 MB. Hither's what that value looks like in our php.ini file:
To locate that directive, utilize your text editor's search functionality and modify the value later on the =
sign.
Notice that the number is followed by a single "M" instead of an "MB". Both 128 and 256 MB requite your WordPress installation more than enough resources to execute any scripts or upload the files that you'll demand to use. You tin can also get higher if your figurer has the resources for it, which shouldn't exist a problem with modern devices.
At present repeat the same process for post_max_size
and upload_max_filesize
, using a higher value for the former. In most cases, y'all don't need to go higher than x to 20 MB for either setting. After all, information technology'south rare that you'll find yourself in a situation where you need to upload files of that size to a WordPress website.
In any example, you tin prepare any values that you desire for either directive, equally long as they follow the guidelines we outlined before.
When y'all're done, save the changes to php.ini and shut the file. Then you tin return to the MAMP control panel and click on Start Servers.
Step 2: Cheque Your phpInfo Page
PHP can generate a folio called phpInfo that enables you to check all your server configuration settings without having to navigate the php.ini file.
To access your MAMP phpInfo page, open the tool'southward command panel and click on the Open WebStart folio push button:
WebStart is a local folio that MAMP sets upward, which provides yous with an overview of your server's settings. Yous tin can use WebStart to access the phpInfo page, besides as tools such as phpMyAdmin.
For this tutorial, we're only interested in the sometime, so go alee and click on the phpInfo button at the top of the folio:
Once the page loads, you'll come across an overview of all your PHP settings, which should expect something similar this:
In the screenshot to a higher place, you can see that we set up our memory_limit
value to 128 MB.
Go ahead and utilize your browser's search role to locate all three directives and check that phpInfo reflects their new values.
Summary
MAMP offers i of the easiest means to set up up a local development environs if you use a Windows or macOS device. It's also a fantastic solution if y'all desire to switch betwixt Nginx and Apache for your projects.
Notwithstanding, if y'all're going to apply information technology for WordPress evolution, you lot may need to increase its PHP upload size.
Fortunately, configuring MAMP to increase its upload size is uncomplicated. All you lot take to do is update three directives within your local php.ini file: memory_limit
, post_max_size
, and upload_max_filesize
.
If y'all enjoyed this tutorial, then you lot'll love our support. All Kinsta hosting plans include 24/7 support from our veteran WordPress developers and engineers. Chat with the same team that backs our Fortune 500 clients, and check out our plans today!
Save time, costs and maximize site operation with:
- Instant aid from WordPress hosting experts, 24/7.
- Cloudflare Enterprise integration.
- Global audience reach with 29 data centers worldwide.
- Optimization with our built-in Application Functioning Monitoring.
All of that and much more, in 1 program with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Check out our plans or talk to sales to find the programme that's right for you.
Source: https://kinsta.com/knowledgebase/mamp-increase-upload-size/