Install PHP 8.3 through MAMP Pro (if not already installed). In theory, you can use any other available version; the guide below describes the process using 8.3 as a replacement target.
brew install [email protected]sudo mv /Applications/MAMP/bin/php/php8.3.0 /Applications/MAMP/bin/php/php8.3.0.backupsudo cp -R /usr/local/Cellar/[email protected]/8.4.16_1 /Applications/MAMP/bin/php/php8.3.0sudo cp -R /Applications/MAMP/bin/php/php8.3.0.backup/conf /Applications/MAMP/bin/php/php8.3.0/sudo mkdir -p /Applications/MAMP/bin/php/php8.3.0/modules
sudo cp /usr/local/Cellar/[email protected]/8.4.16_1/lib/httpd/modules/libphp.so /Applications/MAMP/bin/php/php8.3.0/modules/sudo chmod -R 755 /Applications/MAMP/bin/php/php8.3.0After completing these steps, PHP 8.4.1 will be running under the 8.3 designation:
/Applications/MAMP/bin/php/php8.3.0/bin/php -vExpected output:
PHP 8.4.16 (cli) (built: Dec 16 2025 16:03:34) (NTS)
Note: When installing via Homebrew,
/usr/local/opt/[email protected]is a symlink to/usr/local/Cellar/[email protected]/8.4.16_1. Therefore, you should work with the physical directory path.
If you encounter any issues:
- Ensure all paths are correct
- Verify that permissions are properly set
- Check MAMP logs for any errors
- Make sure the backup was created successfully before proceeding