installphp.info


← Back to home page

Install PHP 7.1 on macOS 11

This version of PHP is actively supported.

Good news! PHP 7.1 is being actively supported through 20 Sep 2024. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 20 Sep 2024, at which point PHP 7.1 will be considered "end-of-life".

Installing PHP 7.1 on macOS 11

Prerequisites

  • macOS 11 (Big Sur) installed
  • Terminal access
  • Homebrew package manager installed

Installation

  1. Open Terminal
  2. Update Homebrew:
    brew update
  3. Install PHP 7.1:
    brew install [email protected]
  4. Link PHP 7.1:
    brew link [email protected] --force
  5. Add PHP to your PATH:
    echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
  6. Reload your shell configuration:
    source ~/.bash_profile

Verification

  1. Check PHP version:
    php -v
  2. Verify PHP configuration:
    php --ini
  3. Test PHP installation:
    php -r "phpinfo();"