Skip to content

Instantly share code, notes, and snippets.

@AviiNL
Last active December 17, 2015 11:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AviiNL/2dc9e7a903ff58117206 to your computer and use it in GitHub Desktop.
Save AviiNL/2dc9e7a903ff58117206 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Remove old repositories due to conflicts
rm -rf /etc/yum.repos.d/ocaml.repo
rm -rf /etc/yum.repos.d/hop5.repo
rm -rf /etc/yum.repos.d/epel.repo
rm -rf /etc/yum.repos.d/epel-testing.repo
yum install -y postgresql94-devel zeromq-devel libpqxx-devel
export LD_LIBRARY_PATH=/usr/pgsql-9.4/lib/
export C_INCLUDE_PATH=/usr/pgsql-9.4/include/
export CPLUS_INCLUDE_PATH=/usr/pgsql-9.4/include/
ldconfig
# Get the sources
git clone https://github.com/PocketRent/hhvm-pgsql.git hhvm-pgsql
git clone https://github.com/Orvid/php-zmq.git hhvm-zmq
# prepare folders
mkdir /etc/hhvm
mkdir /etc/hhvm/extensions
mkdir /var/log/hhvm
mkdir /var/run/hhvm
# prepare php.ini to load the modules
touch /etc/hhvm/php.ini
# Logging in php.ini
echo 'hhvm.log.use_log_file = true' >> /etc/php.ini
echo 'hhvm.log.file = /var/log/hhvm/error.log' >> /etc/php.ini
# Add loading paths to php.ini
echo 'hhvm.dynamic_extension_path = /etc/hhvm/extensions/' >> /etc/hhvm/php.ini
echo 'hhvm.extension_path = /etc/hhvm/extensions/' >> /etc/hhvm/php.ini
cd hhvm-pgsql
/usr/local/bin/hphpize
cmake .
make
make install
cp /usr/local/lib64/hhvm/extensions/20150212/pgsql.so /etc/hhvm/extensions/pgsql.so
echo 'hhvm.extensions[pgsql] = pgsql.so' >> /etc/hhvm/php.ini
cd ..
cd hhvm-zmq
/usr/local/bin/hphpize
cmake .
make
make install
cp /usr/local/lib64/hhvm/extensions/20150212/zmq.so /etc/hhvm/extensions/zmq.so
echo 'hhvm.dynamic_extensions[pgsql] = pgsql.so' >> /etc/hhvm/php.ini
# stop any hhvm process
killall hhvm
# start the daemon with the newly loaded modules
/usr/local/bin/hhvm --mode daemon -d hhvm.server.type=fastcgi -d hhvm.server.port=9000 --config /etc/hhvm/php.ini
#!/bin/bash
# hop5 provides g++ 4.8 and Image Magick
wget http://www.hop5.in/yum/el6/hop5.repo -O /etc/yum.repos.d/hop5.repo
# ocaml current version
wget http://download.opensuse.org/repositories/home:/ocaml/CentOS_6/home:ocaml.repo -O /etc/yum.repos.d/ocaml.repo
# epel has libDwarf with a later version
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# install dependencies
yum install git cmake gcc-c++ libgcc glibc-devel glog-devel boost-devel mysql-devel libevent-devel curl-devel \
libxml2-devel tbb-devel oniguruma-devel readline-devel libdwarf-devel elfutils-libelf-devel \
libcap-devel expat-devel gmp-devel libmemcached-devel bzip2-devel ImageMagick-devel libxslt-devel \
libmcrypt-devel libyaml-devel openldap-devel ocaml gperf libpng-devel jemalloc-devel \
binutils gzip bzip2 make tar perl zip unzip wget -y
# get the hhvm sources and dependencies
git clone git://github.com/facebook/hhvm.git --depth=1
cd hhvm
git submodule update --init --recursive
cmake .
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment