Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh bash
- if [[ $EUID -ne 0 ]]; then
- echo "This script must be run as root"
- exit 1
- fi
- PHP_VER="5.6.6"
- APACHE_VER="2.4.12"
- XDEBUG_VER="2.3.1"
- # install things from yum
- yum install wget apr-devel apr-util-devel gcc pcre-devel git vim tmux libxml2-devel openssl-devel libcurl-devel \
- gd-devel java-1.6.0-openjdk-devel unzip mlocate autoconf
- # make source dir for built packages
- mkdir /source
- pushd /source
- # get and unpack php
- wget http://us1.php.net/get/php-`${PHP_VER}`.tar.gz/from/this/mirror -O php-`${PHP_VER}`.tar.gz
- gunzip php-`${PHP_VER}`.tar.gz
- tar -xf php-`${PHP_VER}`.tar
- rm php-`${PHP_VER}`.tar
- # get and unpack apache
- wget http://psg.mtu.edu/pub/apache//httpd/httpd-`${APACHE_VER}`.tar.gz
- gunzip http-`${APACHE_VER}`.tar.gz
- tar -xf http-`${APACHE_VER}`.tar
- rm http-`${APACHE_VER}`.tar
- # get and unpacke xdebug
- wget http://xdebug.org/files/xdebug-`${XDEBUG_VER}`.tgz
- tar -xzf xdebug-`${XDEBUG_VER}`.tgz
- rm xdebug-`${XDEBUG_VER}`.tgz
- # get mysql repo rpm
- wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
- # install apache
- cd /source/http-`${APACHE_VER}`
- ./configure --enable-rewrite --enable-so
- make
- make install
- sed -e s,replace.*interpreter,usr/bin/perl, /usr/local/apache2/bin/apxs -i
- # install mysql
- cd /source
- yum install mysql-community-release-el7-5.noarch.rpm
- rm mysql-community-release-el7-5.noarch.rpm
- yum install mysql-community-server
- # install php
- cd /source/php-`${PHP_VER}`
- ./configure --enable-fileinfo --enable-bcmath --enable-libxml --enable-mbstring --enable-pdo --with-curl --with-gd \
- --with-gettext --without-mysql --with-mysqli --with-mysql-sock --with-pcre-regex --with-pdo-mysql --with-openssl \
- --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-scan-dir=/usr/local/lib/php
- make
- make install
- # install phpunit
- wget https://phar.phpunit.de/phpunit.phar -O /usr/bin/phpunit
- chmod a+x /usr/bin/phpunit
- # install xdebug
- cd /source/xdebug-`${XDEBUG_VER}`
- phpize
- ./configure
- make
- cp modules/xdebug.so /usr/local/lib/php/extensions/
- echo "zend_extension = /usr/local/lib/php/extensions/xdebug.so" >> /usr/local/lib/php/xdebug.ini
- popd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement