Skip to content
MAMP PRO Documentation

PHP

PHP is a popular web scripting language. MAMP PRO installs several versions of the PHP interpreter.

MAMP


  • Default version
    Select which PHP version will be the default version. To view the php template file press the ”+” button.

  • Make this version available on the command line
    Check this option to add the current PHP version to the system path. You can verify this by checking the System PATH in Advanced System Settings › Environment Variables › System Variables.

    MAMP

    MAMP


  • Mode
    Choose whether to use identical PHP versions for all sites (module mode) or on a host by host basis (CGI mode).

    • Identical PHP versions for all sites (module mode)
      In module mode all hosts use the same PHP version.
    • Individual PHP version for every host (CGI mode)
      In CGI Mode the PHP settings will be identical for all sites – except for the PHP version. Navigate to the Settings › Hosts section to change the PHP version for each individual site. More information on how to change the PHP version for an individual host is covered in the Settings › Hosts › General section.

  • Cache module to speed up PHP execution
    PHP has several cache extensions that can help speed up execution in certain circumstances. This is set to “off” by default. Enabling a cache extension does not necessarily result in greater execution speed. A particular cache is not available for the current PHP version if it is not enabled.

    • off
      No cache will be used.
    • OPcache
      OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. See the OPcache documentation for more information.

    MAMP


  • Extensions

    • Xdebug (Debugger)
      Activate Xdebug to allow PHP to create debugging information during script execution. By default, Xdebug uses localhost and port 9000 in the PHP.ini file.

    • Imagick / ImageMagick
      Activate Imagick / ImageMagick.

    • Tidy
      Activate Tidy.

    • Oauth
      Activate Oauth.

    • Open XDClient
      With Xdebug activated you can open the XDClient debugger to enable PHP debugging. By default, XDClient expects debugging information on port 9000 of localhost.


  • What to log
    Determine which error types should be reported.

    • Display startup errors
      Log PHP errors that occur when Apache loads the PHP module.

    • All errors and warnings
      All errors will be reported.

    • Errors
      Script errors that make the further execution of the current PHP script impossible.

    • Warnings
      General errors in the PHP environment.

    • Notices
      Possible problems that do not directly concern PHP but may indicate an error in a script.

    • Other
      Report additional error types using constants. See the PHP documentation for more information.


  • Log Errors
    Determine if errors should be recorded in a log file and/or displayed in a web browser window.

More information on how to connect to MySQL using PHP (PHP ≤ 5.5.x) and connect to MySQL using PHP (PHP ≥ 5.6.x) can be found in the How Tos section.