forked from mrded/brew-emp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·94 lines (75 loc) · 3.17 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
case "$1" in
"php52")
PHP_VERSION='52' ;;
"php53")
PHP_VERSION='53' ;;
"php54")
PHP_VERSION='54' ;;
"php55")
PHP_VERSION='55' ;;
*)
PHP_VERSION='55' ;;
"php56")
PHP_VERSION='56' ;;
*)
PHP_VERSION='56' ;;
esac
echo "Your choice is PHP${PHP_VERSION}!"
echo "----- ✄ -----------------------"
echo '✩✩✩✩ Add Repositories ✩✩✩✩'
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew update
echo '✩✩✩✩ MYSQL ✩✩✩✩'
brew install mysql
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
echo '✩✩✩✩ NGINX ✩✩✩✩'
brew install --with-passenger nginx
echo '-> Download configs'
mkdir /usr/local/etc/nginx/{common,sites-available,sites-enabled}
curl -Lo /usr/local/etc/nginx/nginx.conf https://raw.github.com/mrded/brew-emp/master/conf/nginx/nginx.conf
curl -Lo /usr/local/etc/nginx/common/php https://raw.github.com/mrded/brew-emp/master/conf/nginx/common/php
curl -Lo /usr/local/etc/nginx/common/drupal https://raw.github.com/mrded/brew-emp/master/conf/nginx/common/drupal
# Download Virtual Hosts.
curl -Lo /usr/local/etc/nginx/sites-available/default https://raw.github.com/mrded/brew-emp/master/conf/nginx/sites-available/default
curl -Lo /usr/local/etc/nginx/sites-available/drupal.local https://raw.github.com/mrded/brew-emp/master/conf/nginx/sites-available/drupal.local
ln -s /usr/local/etc/nginx/sites-available/default /usr/local/etc/nginx/sites-enabled/default
# Create folder for logs.
rm -rf /usr/local/var/log/{fpm,nginx}
mkdir -p /usr/local/var/log/{fpm,nginx}
echo '✩✩✩✩ PHP + FPM ✩✩✩✩'
brew install freetype jpeg libpng gd
brew install php${PHP_VERSION} --without-apache --with-mysql --with-fpm --without-snmp
brew link --overwrite php${PHP_VERSION}
echo '✩✩✩✩ Memcached ✩✩✩✩'
brew install php${PHP_VERSION}-memcached
echo '✩✩✩✩ Xdebug ✩✩✩✩'
brew install php${PHP_VERSION}-xdebug
case "${PHP_VERSION}" in
"52")
DOT_VERSION='5.2' ;;
"53")
DOT_VERSION='5.3' ;;
"54")
DOT_VERSION='5.4' ;;
"55")
DOT_VERSION='5.5' ;;
"56")
DOT_VERSION='5.6' ;;
esac
echo 'xdebug.remote_enable=On' >> /usr/local/etc/php/${DOT_VERSION}/conf.d/ext-xdebug.ini
echo 'xdebug.remote_host="localhost"' >> /usr/local/etc/php/${DOT_VERSION}/conf.d/ext-xdebug.ini
echo 'xdebug.remote_port=9002' >> /usr/local/etc/php/${DOT_VERSION}/conf.d/ext-xdebug.ini
echo 'xdebug.remote_handler="dbgp"' >> /usr/local/etc/php/${DOT_VERSION}/conf.d/ext-xdebug.ini
echo '✩✩✩✩ Xhprof ✩✩✩✩'
brew install graphviz php${PHP_VERSION}-xhprof
mkdir /tmp/xhprof
chmod 777 /tmp/xhprof
echo 'xhprof.output_dir=/tmp/xhprof' >> /usr/local/etc/php/${DOT_VERSION}/conf.d/ext-xhprof.ini
curl -Lo /usr/local/etc/nginx/sites-available/xhprof.local https://raw.github.com/mrded/brew-emp/master/conf/nginx/sites-available/xhprof.local
ln -s /usr/local/etc/nginx/sites-available/xhprof.local /usr/local/etc/nginx/sites-enabled/xhprof.local
sudo echo '127.0.0.1 xhprof.local' >> /etc/hosts
echo '✩✩✩✩ Brew-emp ✩✩✩✩'
curl -Lo /usr/local/bin/brew-emp https://raw.github.com/mrded/brew-emp/master/bin/brew-emp
chmod 755 /usr/local/bin/brew-emp