Homebrew를 이용한 Mac환경에서의 Apache/PHP 개발 환경 구성. MAMP는 너무나 패키지화 되어 있어, 뭔가 맘에 안든다.
그렇다고, 하나 하나 다 내가 깔고 설치하기는 귀찮고.. 그래서 선택한 것이 homebrew!!
아직까지 만족하고 있다...
Apache , PHP , memcahe , APC 환경 설정...
1) Homebrew 설치
ruby -e"$(curl https://raw.github.com/gist/323731/install_homebrew.rb)"
2) PHP : apache + mysql support
brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/php.rb --with-mysql
3) memcache, apc 설치
brew install memcached
brew install memcached-php
brew install memcache-php
brew install apc
4)httpd.conf 수정.
sudo vi /etc/apache2/httpd.conf
추가.
LoadModule php5_module /usr/local/Cellar/php/5.3.8/libexec/apache2/libphp5.so
추가.
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName local.gagamel.com
DocumentRoot /Users/abraxas73/Documents/workspace/gagamel/www
ErrorLog "/Users/abraxas73/Documents/workspace/gagamel/system/logs/error.log"
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
5) php.ini수정
sudo vi /usr/local/etc/php.ini
추가.
extension="/usr/local/Cellar/memcached-php/1.0.2/memcached.so"
추가
extension="/usr/local/Cellar/memcache-php/2.2.6/memcache.so"
추가
[apc]
extension="/usr/local/Cellar/apc/3.1.9/apc.so"
apc.enabled=1
apc.shm_segments=1
apc.shm_size=64M
apc.ttl=7200
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1
수정
short_open_tag = Off
--> On
6) 로컬 멤캐쉬 실행.(optional)
/usr/local/Cellar/memcached/1.4.10/bin/memcached -d -p 11211
/usr/local/Cellar/memcached/1.4.10/bin/memcached -d -p 11212
이 글은 스프링노트에서 작성되었습니다.