본문 바로가기
Programming

맥 M1에 php 설치하기

by Mizix 2022. 7. 29.
반응형

Homebrew 설치

$ code-select --install

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

macOs에서의 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)

Installation — Homebrew Documentation

 

Installation

Documentation for the missing package manager for macOS.

docs.brew.sh

 

Php 패키지 설치

$ brew update # 
$ brew search php # 패키지 검색
brew search php
==> Formulae
brew-php-switcher
php
php-code-sniffer
php-cs-fixer
php-cs-fixer@2
php@7.2
php@7.3
php@7.4 ✔
php@8.0
phpbrew
phplint
phpmd
phpmyadmin
phpstan
phpunit
pcp
pup

$ brew install php@7.4 # 원하는 버전의 php를 설치

Homebrew에 대한 명령어는 아래 링크 참고

brew(1) – The Missing Package Manager for macOS (or Linux) — Homebrew Documentation

 

brew(1) – The Missing Package Manager for macOS (or Linux)

Documentation for the missing package manager for macOS.

docs.brew.sh

 

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

$ brew tap shivammathur/php

$ brew search php
==> Formulae
brew-php-switcher
php
php-code-sniffer
php-cs-fixer
php-cs-fixer@2
php@7.2
php@7.3
php@7.4 ✔
php@8.0
phpbrew
phplint
phpmd
phpmyadmin
phpstan
phpunit
shivammathur/php/php
shivammathur/php/php@5.6
shivammathur/php/php@7.0 ✔
shivammathur/php/php@7.1
shivammathur/php/php@7.2
shivammathur/php/php@7.3
shivammathur/php/php@7.4 ✔
shivammathur/php/php@8.0
shivammathur/php/php@8.2
pcp
pup

$ brew install shivammathur/php/php@7.0

 

반응형