WordPress / 4 MIN READ
MAMP PHP WP settings
Configuring MAMP for WordPress Development
From the original Fervor library. Examples may use older package versions.
Let’s dive into a tutorial for configuring PHP settings like max_input_vars, max_execution_time, and others in MAMP (macOS or Windows). This is perfect if you’re developing WordPress locally and need to tweak your server to handle bigger forms, longer scripts, or more variables.
🚀 Tutorial: How to Configure PHP Settings in MAMP (macOS & Windows)
Whether you’re trying to upload big files or stop WordPress from throwing errors like “Maximum input vars exceeded”, here’s how you can take control of your PHP environment in MAMP.
🔧 Step 1: Locate Your PHP php.ini File
Each version of PHP in MAMP has its own configuration file (php.ini). First, find the one you’re using:
👉 On macOS:
-
Open MAMP.
-
Go to MAMP > Preferences > PHP.
-
Note the selected PHP version (e.g., 8.1.10).
-
Go to Finder and open:
/Applications/MAMP/bin/php/php8.x.x/conf/php.ini(Replace
8.x.xwith your actual PHP version.)
👉 On Windows:
-
Open MAMP.
-
Go to MAMP > Preferences > PHP (or find it in the Control Panel).
-
Note the PHP version.
-
Open the path:
C:\MAMP\bin\php\php8.x.x\php.ini
🛠️ Step 2: Modify PHP Settings
Open the php.ini file in a code editor like VS Code or Sublime Text.
Now tweak these common settings:
max_input_vars = 5000 ; Increase from the default 1000
max_execution_time = 300 ; Time in seconds, default is often 30
memory_limit = 256M ; More memory for heavy scripts
upload_max_filesize = 64M ; For bigger file uploads
post_max_size = 64M ; Should be >= upload_max_filesize
🧠 Why this matters: WordPress plugins like Elementor or WooCommerce often break or misbehave when these limits are too low.
🔄 Step 3: Restart MAMP
Changes won’t apply until you restart your servers.
- Click “Stop Servers” in the MAMP interface.
- Then click “Start Servers”.
Boom — new settings are now active!
✅ Step 4: Verify the Changes
Let’s make sure it worked.
Option 1: Use phpinfo()
-
Create a new file in your MAMP
htdocsfolder:<?php phpinfo(); ?> -
Name it something like
info.php. -
Visit
http://localhost/info.phpin your browser. -
Use CMD/CTRL+F to search for your settings like
max_input_varsand confirm the new values.
Option 2: Use WordPress Tools
- In WP Admin, go to Tools > Site Health > Info > Server.
- You’ll see your updated values there.
🧼 Bonus: Clean Up
Once you’re done, delete your info.php file — you don’t want to leave it lying around for security reasons.
🎯 Final Tips
- If you switch PHP versions in MAMP later, you’ll need to update that version’s
php.initoo. - Want to test limits? Create a giant form in WordPress and try submitting — it’ll show if you’re still hitting input limits.
- For consistent dev environments, consider exporting your settings or documenting changes.
BONUS OVERIDING SKILLS
If you want to override PHP settings specifically for a WordPress site in MAMP (without changing the global php.ini), you’ve got a few slick options — some that work for just one site and others that apply server-wide only inside MAMP.
Let’s break it down with a quick toolkit:
🧰 How to Override PHP Settings for a WordPress Site in MAMP
🏗 Option 1: .htaccess Overrides (Best for Apache + WordPress)
If your MAMP is using Apache (which it usually does by default), this is the most WordPress-friendly way.
- Go to your WordPress site folder inside
htdocs(e.g.htdocs/mywpsite/) - Open or create a file named
.htaccess - Add settings like:
php_value max_input_vars 5000
php_value max_execution_time 300
php_value memory_limit 256M
php_value upload_max_filesize 64M
php_value post_max_size 64M
⚠️ Caution: If MAMP is using nginx or FastCGI,
.htaccesswon’t work. But Apache + mod_php? You’re golden.
📄 Option 2: user.ini File (More Portable & Works with CGI/FastCGI too)
This works even if .htaccess doesn’t — especially for PHP running as CGI/FastCGI (which MAMP sometimes uses).
- In your site root (
htdocs/mywpsite/), create a file named.user.ini - Add:
max_input_vars = 5000
max_execution_time = 300
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
🔄 MAMP checks
.user.inievery 5 minutes by default, so changes may take a short time to reflect.
🧙♂️ Option 3: wp-config.php Constants (Not for All Settings)
For things like memory and timeout, you can set them in WordPress itself.
Edit wp-config.php and add these above the line that says /* That's all, stop editing! */:
@ini_set('max_input_vars', '5000');
@ini_set('max_execution_time', '300');
@ini_set('upload_max_filesize', '64M');
@ini_set('post_max_size', '64M');
define('WP_MEMORY_LIMIT', '256M');
🧠 This doesn’t override everything (like
post_max_sizein uploads), but it’s handy for memory and execution tweaks.
🔎 Final Check
After making these changes, head back to your info.php file or WordPress Site Health (Tools > Site Health > Info > Server) to confirm the values.
🧼 Bonus Tip: Combine Methods
You can stack methods! For example:
- Use
.htaccessfor server settings - Use
wp-config.phpfor WP-specific behavior