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’s remarkably easy to use.
However, if you want to get the most out of it, you’ll need to increase its default upload size.
Since WordPress is built on PHP, the software’s settings can determine how well your website operates. For example, using an outdated version of PHP can prevent you from running the latest WordPress releases. On the same note, having a low memory limit can cause frequent errors.
In this article, we’ll introduce you to MAMP, explain why it’s a smart idea to increase the upload size, then show you how to do it in two simple steps. Let’s get started!
An Introduction to MAMP
MAMP is a tool that lets you set up a local server environment on your macOS or Windows computer. With it, you can install the following software on your computer:
There are plenty of other tools that you can use to install WordPress locally. However, we like MAMP because it provides you with an intuitive control panel and the option to switch between Nginx and Apache for your web server software:
The instructions you’ll find below apply whether you’re using the free version of MAMP or MAMP PRO. You can use either version to install WordPress locally.
Why Increase Your Web Server’s 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 (as far as size is concerned):
memory_limit: This determines how much memory your server can allocate to each PHP script.
post_max_size: This setting controls the maximum size of
POSTdata that your server will allow and plays a role in WordPress file uploads.
upload_max_filesize: The value that you set here determines the file size limit for uploads to your website.
As we mentioned, WordPress is built on PHP. Therefore, all of these settings directly affect your website. If your PHP installation has a low memory limit, you’ll run into problems uploading files and executing scripts on your site.
There’s no ideal PHP memory limit that suits every web server. However, since we’re talking about a local development environment, you have full freedom over how many resources to allocate to your setup. Whereas most web hosts will 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. However, that can lead to errors. The PHP documentation is clear when it indicates that your
post_max_size setting should have a higher value than
memory_limit should have a higher value than
post_max_size. As long as your PHP settings adhere to those guidelines, you should be golden.
How To Increase the Upload Size for Your Local MAMP Web Server (in 2 Steps)
For this tutorial, we’ll show you how to configure MAMP to increase its upload size on both Windows and macOS. We’ll also use the MAMP control panel to ensure that you updated your server settings successfully.
Step 1: Modify Your php.ini File
Modifying your PHP settings in MAMP is easy. To do so, you’ll need to edit your MAMP installation’s php.ini file.
You can access that file in one 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.x/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 want to access the folder that corresponds to it.
To double-check which version of PHP you’re using, open the MAMP control panel, go to MAMP > Preferences > PHP, and then look at the version number next to “Standard Version”:
Next, you can return to the conf directory and access the folder that correlates to that version. Inside, you’ll find a lone php.ini file. Go ahead and open it using your favorite text editor, and you’ll see something like this:
As we explained in the last section, you need to look for the following three directives:
We recommend setting a memory limit of 128 or 256 MB. Here’s what that value looks like in our php.ini file:
To locate that directive, use your text editor’s search functionality and modify the value after the
Notice that the number is followed by a single “M” instead of an “MB”. Both 128 and 256 MB give your WordPress installation more than enough resources to execute any scripts or upload the files that you’ll need to use. You can also go higher if your computer has the resources for it, which shouldn’t be a problem with modern devices.
Now repeat the same process for
upload_max_filesize, using a higher value for the former. In most cases, you don’t need to go higher than 10 to 20 MB for either setting. After all, it’s rare that you’ll find yourself in a situation where you need to upload files of that size to a WordPress website.
In any case, you can set whatever values that you want for either directive, as long as they follow the guidelines we outlined earlier.
When you’re done, save the changes to php.ini and close the file. Then you can return to the MAMP control panel and click on Start Servers.
Step 2: Check Your phpInfo Page
PHP can generate a page 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’s control panel and click on the Open WebStart page button:
WebStart is a local page that MAMP sets up, which provides you with an overview of your server’s settings. You can use WebStart to access the phpInfo page, as well as tools such as phpMyAdmin.
For this tutorial, we’re only interested in the former, so go ahead and click on the phpInfo button at the top of the page:
Once the page loads, you’ll see an overview of all your PHP settings, which should look something like this:
In the screenshot above, you can see that we set our
memory_limit value to 128 MB.
Go ahead and use your browser’s search function to locate all three directives and check that phpInfo reflects their new values.
MAMP offers one of the easiest ways to set up a local development environment if you use a Windows or macOS device. It’s also a fantastic solution if you want to switch between Nginx and Apache for your projects.
However, if you’re going to use it for WordPress development, you may need to increase its PHP upload size.
Fortunately, configuring MAMP to increase its upload size is simple. All you have to do is update three directives within your local php.ini file:
If you enjoyed this tutorial, then you’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 performance with:
- Instant help from WordPress hosting experts, 24/7.
- Cloudflare Enterprise integration.
- Global audience reach with 32 data centers worldwide.
- Optimization with our built-in Application Performance Monitoring.
All of that and much more, in one plan 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 plan that’s right for you.