4 echo "Press RETURN to continue, or ^C to cancel.";
8 RHEL_VER_FILE
="/etc/redhat-release"
10 if [[ ! -f $RHEL_VER_FILE ]]
12 echo "It looks like you're not running a Red Hat-derived distribution."
13 echo "This script is intended to install Phabricator on RHEL-derived"
14 echo "distributions such as RHEL, Fedora, CentOS, and Scientific Linux."
15 echo "Proceed with caution."
19 echo "PHABRICATOR RED HAT DERIVATIVE INSTALLATION SCRIPT";
20 echo "This script will install Phabricator and all of its core dependencies.";
21 echo "Run it from the directory you want to install into.";
24 RHEL_REGEX
="release ([0-9]+)\."
26 if [[ $
(cat $RHEL_VER_FILE) =~
$RHEL_REGEX ]]
28 RHEL_MAJOR_VER
=${BASH_REMATCH[1]}
30 echo "Ut oh, we were unable to determine your distribution's major"
31 echo "version number. Please make sure you're running 6.0+ before"
36 if [[ $RHEL_MAJOR_VER < 6 && $RHEL_MAJOR_VER > 0 ]]
39 echo "A major version less than 6 was detected. Because of this,"
40 echo "several needed dependencies are not available via default repos."
41 echo "Specifically, RHEL 5 does not have a PEAR package for php53-*."
42 echo "We will attempt to install it manually, for APC. Please be careful."
46 echo "Phabricator will be installed to: $(pwd).";
49 echo "Testing sudo/root..."
50 if [[ $EUID -ne 0 ]] # Check if we're root. If we are, continue.
56 echo "ERROR: You must be able to sudo to run this script, or run it as root.";
62 if [[ $RHEL_MAJOR_VER == 5 ]]
64 # RHEL 5's "php" package is actually 5.1. The "php53" package won't let us install php-pecl-apc.
65 # (it tries to pull in php 5.1 stuff) ...
66 yum repolist |
grep -i epel
68 echo "It doesn't look like you have the EPEL repo enabled. We are to add it"
69 echo "for you, so that we can install git."
70 $SUDO rpm
-Uvh https
://download.fedoraproject.org
/pub
/epel
/5/i386
/epel-release-5-4.noarch.rpm
72 YUMCOMMAND
="$SUDO yum install httpd git php53 php53-cli php53-mysql php53-process php53-devel php53-gd gcc wget make pcre-devel mysql-server"
74 # RHEL 6+ defaults with php 5.3
75 YUMCOMMAND
="$SUDO yum install httpd git php php-cli php-mysql php-process php-devel php-gd php-pecl-apc php-pecl-json php-mbstring mysql-server"
78 echo "Dropping to yum to install dependencies..."
79 echo "Running: ${YUMCOMMAND}"
80 echo "Yum will prompt you with [Y/n] to continue installing."
86 echo "The yum command failed. Please fix the errors and re-run this script."
90 if [[ $RHEL_MAJOR_VER == 5 ]]
92 # Now that we've ensured all the devel packages required for pecl/apc are there, let's
93 # set up PEAR, and install apc.
94 echo "Attempting to install PEAR"
95 wget https
://pear.php.net
/go-pear.phar
96 $SUDO php go-pear.phar
&& $SUDO pecl
install apc
101 echo "The apc install failed. Continuing without APC, performance may be impacted."
104 pidof httpd
2>&1 > /dev
/null
107 echo "If php was installed above, please run: /etc/init.d/httpd graceful"
109 echo "Please remember to start the httpd with: /etc/init.d/httpd start"
112 pidof mysqld
2>&1 > /dev
/null
115 echo "Please remember to start the mysql server: /etc/init.d/mysqld start"
120 if [[ ! -e libphutil
]]
122 git clone https
://github.com
/phacility
/libphutil.git
124 (cd libphutil
&& git pull
--rebase)
127 if [[ ! -e arcanist
]]
129 git clone https
://github.com
/phacility
/arcanist.git
131 (cd arcanist
&& git pull
--rebase)
134 if [[ ! -e phabricator
]]
136 git clone https
://github.com
/phacility
/phabricator.git
138 (cd phabricator
&& git pull
--rebase)
143 echo "Install probably worked mostly correctly. Continue with the 'Configuration Guide':";
145 echo " https://secure.phabricator.com/book/phabricator/article/configuration_guide/";