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

MAMP Pro v4.4多主机配置及PHP版本切换问题求助

Hey there! Let's walk through the common gotchas that might be tripping you up when assigning a custom PHP version to a new host in MAMP Pro 4.4 on High Sierra. I’ve helped folks troubleshoot this exact scenario before, so let’s break it down step by step:

Troubleshooting Custom PHP Versions for New Hosts in MAMP Pro 4.4 (High Sierra)

1. Double-Check PHP Version Availability Globally

First, make sure the PHP version you want to use is actually enabled in MAMP Pro’s global settings—this is a super easy step to miss:

  • Open MAMP Pro, click the PHP tab in the top navigation bar.
  • Look for your target version in the list; if it’s grayed out, tick the checkbox to enable it. MAMP Pro only lets you assign versions that are active system-wide.
  • Don’t forget to hit Save after enabling the version—changes won’t apply until you do this.

2. Verify Host-Specific PHP Settings

When setting up your new host, it’s easy to overlook the host-specific PHP dropdown. Let’s confirm you’re configuring it right:

  • Select your new host from the left sidebar to open its settings.
  • Navigate to the PHP tab for this individual host.
  • Under "PHP Version," make sure you’re picking your desired custom version, not the "Default" option (which uses the global default PHP).
  • Save the host settings, then fully stop and restart MAMP Pro’s servers (use the Stop Servers and Start Servers buttons in the toolbar—restarting is non-negotiable here).

3. Fix Document Root Permissions (High Sierra Quirk)

High Sierra has stricter file permissions, and this can interfere with PHP execution for specific hosts:

  • Open Finder, go to the htdocs subfolder for your new host.
  • Right-click the folder → Get Info.
  • Under Sharing & Permissions, ensure your user account has Read & Write access. Click the gear icon and select "Apply to enclosed items" to propagate permissions to all files inside.
  • If permissions are still wonky, fix them via Terminal with these commands (replace /path/to/your/htdocs/subfolder and your_username with your actual path and Mac username):
    sudo chmod -R 755 /path/to/your/htdocs/subfolder
    sudo chown -R your_username:staff /path/to/your/htdocs/subfolder
    
    (Run whoami in Terminal if you need to confirm your username.)

4. Test the PHP Version Directly

After making changes, verify the correct version is active for your host:

  • Create a phpinfo.php file in the host’s document root with this code:
    <?php phpinfo(); ?>
    
  • Access this file via your browser (both locally and remotely, since you use DDNS). Look for the "PHP Version" line at the top—it should match your assigned version.
  • If it still shows the default version, clear your browser cache or test in incognito mode to rule out caching issues.

5. MAMP Pro 4.4-Specific Bug Workaround

Some users have reported that in MAMP Pro 4.4, the PHP version dropdown doesn’t save correctly unless you toggle the server type first:

  • For your new host, go to the General tab.
  • Toggle the server (e.g., switch from Apache to Nginx, then switch back to Apache).
  • Return to the PHP tab, reselect your desired version, save, and restart servers. This forces MAMP Pro to refresh the host’s configuration files.

6. Manually Check Configuration Files (Advanced)

If all else fails, verify the host’s config file points to the correct PHP version:

  • Apache: Host configs live in /Library/Application Support/appsolute/MAMP PRO/conf/apache/hosts/your-host-name.conf. Open it in a text editor and look for lines like AddHandler application/x-httpd-php74 .php—the version number should match your selection.
  • Nginx: Configs are in /Library/Application Support/appsolute/MAMP PRO/conf/nginx/hosts/your-host-name.conf. Look for fastcgi_pass unix:/Applications/MAMP/Library/logs/fastcgi/PHP-7.4.3.sock (again, check the version number).
  • If the config has the wrong version, recheck your host settings, save, and restart servers—MAMP Pro should regenerate the config correctly.

Chances are one of these small, easy-to-miss steps will fix your issue. Let me know if you hit any snags!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.20 07:19:07