OSX php7.4 설치

PHP 2022. 4. 21. 15:07

1. 설치

 

$ brew upgrade php@7.4

 

==> Downloading https://www.freetds.org/files/stable/freetds-1.3.10.tar.gz
Error: php@7.4: Failed to download resource "freetds"
Download failed: Homebrew-installed `curl` is not installed for: https://www.freetds.org/files/stable/freetds-1.3.10.tar.gz
Chan-ui-Mac-mini:httpd ds1ttc$ brew install curl
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.

Warning: You are using macOS 10

curl 이 설치 안되어 있어서 freetds 가 설치가 안된다.

 

curl 을 설치

 

$ brew install curl

 

다시 php 설치

 

$ brew upgrade php@7.4

 

설치 후 php restart

 

$ brew services restart php@7.4

 

버전 확인

 

Chan-ui-Mac-mini:httpd ds1ttc$ php -v
PHP 7.1.33 (cli) (built: Jan 18 2020 13:49:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Chan-ui-Mac-mini:httpd ds1ttc$

여전히 예전 버전이 나옴.

 

.profile 에 등록해 주자.

 

 

$ echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"' >> ~/.profile
$ echo 'export PATH="/usr/local/opt/php@7.4/sbin:$PATH"' >> ~/.profile

$ source .profile

 

다시 버전 확인

 

Chan-ui-Mac-mini:~ ds1ttc$ php -v
PHP 7.4.29 (cli) (built: Apr 21 2022 07:59:48) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies
Chan-ui-Mac-mini:~ ds1ttc$

 

그래도 예전 버전이 나온다면 

터미널을 새로 열어서 해 볼 것.

 

블로그 이미지

엘로드넷

댓글을 달아 주세요