You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MAMP v4.4.1无法修改php.ini以适配WordPress模板配置求助

Fixing php.ini Modification Issues in MAMP 4.4.1 (Mac OS X High Sierra)

Hey there, let's walk through how to successfully tweak your php.ini settings for WordPress on MAMP—this is a super common gotcha because MAMP hides its active php.ini file in a non-obvious spot, so you might’ve been editing the wrong one this whole time. Here’s your step-by-step fix:

1. Find the actual php.ini file MAMP is using

First, we need to confirm which php.ini your server is actively loading (editing any other file won’t do a thing):

  • Open your phpinfo page at http://localhost:8888/MAMP/index.php?language=English&page=phpinfo
  • Hit Cmd+F to search for Loaded Configuration File
  • Copy the full file path shown here (it’ll look something like /Applications/MAMP/bin/php/php7.1.12/conf/php.ini—the version number depends on your MAMP setup)

2. Edit the php.ini file with your required parameters

Now let’s open and modify the correct file using Terminal:

  1. Launch Terminal (you’ll find it in Applications > Utilities)

  2. Run this command, replacing [your-copied-path] with the path you grabbed from phpinfo:

    nano [your-copied-path]
    

    If you hit a permission error, prepend sudo to run it as an admin (you’ll need to enter your Mac user password when prompted):

    sudo nano [your-copied-path]
    
  3. Locate each of these parameters and update their values—if a parameter doesn’t exist, add it to the [PHP] section of the file:

    • memory_limit = 96M
    • max_input_vars = 3000
    • max_execution_time = 120
    • post_max_size = 32M
    • upload_max_filesize = 32M
  4. Save your changes and exit:

    • In nano, press Ctrl+O, then hit Enter to confirm the filename
    • Press Ctrl+X to close the editor

3. Restart MAMP servers

Your changes won’t take effect until you restart MAMP:

  • Open the MAMP app
  • Click Stop Servers (wait for them to fully shut down)
  • Click Start Servers again

4. Verify your changes worked

Head back to the phpinfo page and search for each modified parameter. You should see your new values (96M, 3000, 120, 32M) listed—this means the settings are active and ready for WordPress.

Quick Heads-Up to Avoid Frustration

Don’t waste time editing the php.ini file in /Applications/MAMP/conf/php/[php-version]/—that’s just a template file, not the one MAMP actually uses. Always trust the Loaded Configuration File path from phpinfo to make sure you’re editing the right file.

内容的提问来源于stack exchange,提问作者NanoVector

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:05:56