Skip to content
MAMP PRO Documentation

PHP versions

PHP releases new major versions every few years, with regular minor updates and patches in between. Each major version introduces changes that can break existing code – functions are renamed, removed, or changed in behavior. As a result, different projects often require different PHP versions:

  • A WordPress site from 2019 may require PHP 7.4
  • A modern Laravel application may require PHP 8.2 or higher
  • A legacy system may be stuck on PHP 7.1

Many hosting providers let you choose a PHP version per site or virtual host – and MAMP PRO mirrors exactly this capability on your local machine. Each site can run its own PHP version independently, making it easy to replicate the exact server environment of each project.

MAMP PRO ships with a range of PHP versions pre-installed under /Applications/MAMP/bin/php/. Each version is a complete, self-contained PHP installation with its own set of extensions and its own php.ini configuration file.

You select the PHP version for each site individually in the site settings under Sites › [site name] › General › Basic → PHP version. The available options depend on which versions are installed.

Every site has two options for its PHP version:

  • Default (x.y.z) – The site uses whatever version is currently set as the global default in Settings › Languages › PHP. If you change the default, all sites set to “Default” update automatically.
  • A specific version – The site is pinned to that version regardless of what the default is.

This distinction matters in practice. If you have ten sites and you update the default PHP version to test compatibility, all sites on “Default” switch at once. Sites pinned to a specific version are unaffected. Use “Default” for new projects you actively maintain; use a pinned version for legacy code that must not change.

Each PHP version has its own php.ini file located at:

/Applications/MAMP/bin/php/phpX.Y.Z/conf/php.ini

In MAMP PRO, PHP settings must be edited via the Template Editor (File › Open Template › PHP). Editing php.ini directly has no effect – the file is regenerated from the template every time the servers restart.

Common settings you might need to adjust:

SettingWhat it controls
memory_limitMaximum memory a script can use
upload_max_filesizeMaximum file size for uploads
post_max_sizeMaximum size of POST data
max_execution_timeMaximum time a script may run
xdebug.modeXdebug operating mode

To confirm which PHP version a site is currently using, see How can I check the local PHP settings?

Each PHP version comes with a set of pre-compiled extensions. To see which extensions are active for a given version, call phpinfo() or open WebStart → Tools → phpInfo.

If you need an extension that is not included, you can install it via PECL. See Install a PHP extension using PECL for the procedure.