맥 M1에 php 설치하기

1. Homebrew 설치

macOS Requirements

  • A 64-bit Intel CPU or Apple Silicon CPU
  • macOS Catalina (10.15) (or higher)
  • Command Line Tools (CLT) for Xcode (from xcode-select –install or https://developer.apple.com/download/all/) or Xcode
  • The Bourne-again shell for installation (i.e. bash)
$ code-select --install

# Homebrew 설치
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Installation — Homebrew Documentation

2. Php 패키지 설치

$ brew update # 
$ brew search php # 패키지 검색
brew search php
==> Formulae
brew-php-switcher
php
php-code-sniffer
php-cs-fixer
php-cs-fixer@2
[email protected]
[email protected]
[email protected][email protected]
phpbrew
phplint
phpmd
phpmyadmin
phpstan
phpunit
pcp
pup

$ brew install [email protected] # 원하는 버전의 php를 설치

Homebrew에 대한 명령어는 아래 링크 참고
brew(1) – The Missing Package Manager for macOS (or Linux) — Homebrew Documentation

참고. Homebrew에서 지원하지 않는 버전의 Php 설치

$ brew tap shivammathur/php

$ brew search php
==> Formulae
brew-php-switcher
php
php-code-sniffer
php-cs-fixer
php-cs-fixer@2
[email protected]
[email protected]
[email protected][email protected]
phpbrew
phplint
phpmd
phpmyadmin
phpstan
phpunit
shivammathur/php/php
shivammathur/php/[email protected]
shivammathur/php/[email protected] ✔
shivammathur/php/[email protected]
shivammathur/php/[email protected]
shivammathur/php/[email protected]
shivammathur/php/[email protected] ✔
shivammathur/php/[email protected]
shivammathur/php/[email protected]
pcp
pup

$ brew install shivammathur/php/[email protected]

댓글 남기기