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

OSX系统MAMP启用PHP intl扩展报错(make: *** [php_intl.lo] Error 1)求助

Fixing make: *** [php_intl.lo] Error 1 When Enabling PHP intl Extension for CakePHP on MAMP

Hey there, let's work through this intl extension issue together—compiling PHP extensions with MAMP can be tricky, but we'll get it sorted. Here are targeted steps to try:

You mentioned creating a symlink, but it might be pointing to an outdated or missing SDK. Let's verify and fix that:

  • First, list all available Xcode SDKs on your system:
    ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
    
  • If you don't see MacOSX10.10.sdk (or it's not compatible with your current OS), delete the old symlink:
    sudo rm /Applications/MAMP/bin/php/php7.1.6/include
    
  • Create a new symlink using the actual SDK version you found (replace MacOSX[YourSDKVersion].sdk with the correct name, e.g., MacOSX13.sdk):
    sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX[YourSDKVersion].sdk/usr/include /Applications/MAMP/bin/php/php7.1.6/include
    

2. Skip Compilation—Check if MAMP Already Includes the intl Extension

Sometimes MAMP ships with the intl extension pre-built but disabled. Let's confirm:

  • Open your MAMP PHP config file: /Applications/MAMP/bin/php/php7.1.6/conf/php.ini
  • Search for the line ;extension=intl (the semicolon means it's commented out)
  • Remove the semicolon to enable it: extension=intl
  • Save the file and restart MAMP. Test if CakePHP recognizes the extension now.

3. Compile intl Extension with Proper ICU Dependencies

If you still need to compile, the error often stems from missing ICU libraries (intl depends on ICU). Here's how to fix that:

  1. Install ICU via Homebrew (install Homebrew first if you don't have it):
    brew install icu4c
    
  2. Download PHP 7.1.6 Source Code: Grab the exact matching source from PHP's official releases (it must be PHP 7.1.6 to align with your MAMP version).
  3. Navigate to the intl Extension Directory: Unzip the PHP source, then move into:
    cd path/to/php-7.1.6/ext/intl
    
  4. Prepare the Extension:
    /Applications/MAMP/bin/php/php7.1.6/bin/phpize
    
  5. Configure with ICU Path:
    ./configure --with-php-config=/Applications/MAMP/bin/php/php7.1.6/bin/php-config --with-intl --with-icu-dir=$(brew --prefix icu4c)
    
  6. Compile and Install:
    make
    sudo make install
    

4. Fix Permission Issues

Compilation errors can also happen due to restricted write access to MAMP's directories. Fix permissions with:

sudo chown -R $(whoami) /Applications/MAMP/bin/php/php7.1.6

Then retry the compilation steps.

5. Get Detailed Error Output

If you still get the Error 1, run make again with verbose output to uncover the actual root cause:

make 2>&1 | more

Look for specific errors like missing header files or ICU version mismatches—this will help pinpoint exactly what's going wrong.

Let me know if any of these steps resolve your issue, or share the detailed error output from make and we can dig deeper.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 09:41:18