Prindol

DESIGN, HTML5, CSS3, DOM, Jquery, JSON, Actionscript2/3, Linux, IIS

You are not logged in.

#1 2021-12-15 01:29:42

skydown
Administrator
Registered: 2011-07-25
Posts: 324

[M1] Apache / PHP

맥북m1(Big Sur)으로 AMP(apache, mysql, php) 개발 환경 설정하기

# 아파치 중지 및 자동 실행 스크립트 삭제

$ sudo apachectl stop
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# 아파치 설치하기

$ brew install httpd

# 아파치 시작하기

$ brew services start httpd

# 아파치 설정 테스트

$ httpd -t

# 아파치 설정

$ vi /opt/homebrew/etc/httpd/httpd.conf
Listen 80

ServerName localhost

# PHP 설치

$ brew install shivammathur/php/php@7.3
$ echo 'export PATH="/opt/homebrew/opt/php@7.3/bin:$PATH"' >> ~/.zshrc
$ echo 'export PATH="/opt/homebrew/opt/php@7.3/sbin:$PATH"' >> ~/.zshrc
$ export LDFLAGS="-L/opt/homebrew/opt/php@7.3/lib"
$ export CPPFLAGS="-I/opt/homebrew/opt/php@7.3/include"
$ brew services start shivammathur/php/php@7.3
$ php -v

# httpd.conf 설정 추가

    LoadModule php7_module /opt/homebrew/opt/php@7.3/lib/httpd/modules/libphp7.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>
 DirectoryIndex index.php index.html

Offline

Board footer

Powered by FluxBB