Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.14 KB | None | 0 0
  1. #!/bin/sh bash
  2. if [[ $EUID -ne 0 ]]; then
  3.    echo "This script must be run as root"
  4.    exit 1
  5. fi
  6.  
  7. PHP_VER="5.6.6"
  8. APACHE_VER="2.4.12"
  9. XDEBUG_VER="2.3.1"
  10.  
  11. # install things from yum
  12. yum install wget apr-devel apr-util-devel gcc pcre-devel git vim tmux libxml2-devel openssl-devel libcurl-devel \
  13.    gd-devel java-1.6.0-openjdk-devel unzip mlocate autoconf
  14.  
  15. # make source dir for built packages
  16. mkdir /source
  17. pushd /source
  18.  
  19. # get and unpack php
  20. wget http://us1.php.net/get/php-`${PHP_VER}`.tar.gz/from/this/mirror -O php-`${PHP_VER}`.tar.gz
  21. gunzip php-`${PHP_VER}`.tar.gz
  22. tar -xf php-`${PHP_VER}`.tar
  23. rm php-`${PHP_VER}`.tar
  24.  
  25. # get and unpack apache
  26. wget http://psg.mtu.edu/pub/apache//httpd/httpd-`${APACHE_VER}`.tar.gz
  27. gunzip http-`${APACHE_VER}`.tar.gz
  28. tar -xf http-`${APACHE_VER}`.tar
  29. rm http-`${APACHE_VER}`.tar
  30.  
  31. # get and unpacke xdebug
  32. wget http://xdebug.org/files/xdebug-`${XDEBUG_VER}`.tgz
  33. tar -xzf xdebug-`${XDEBUG_VER}`.tgz
  34. rm xdebug-`${XDEBUG_VER}`.tgz
  35.  
  36. # get mysql repo rpm
  37. wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
  38.  
  39. # install apache
  40. cd /source/http-`${APACHE_VER}`
  41. ./configure --enable-rewrite --enable-so
  42. make
  43. make install
  44. sed -e s,replace.*interpreter,usr/bin/perl, /usr/local/apache2/bin/apxs -i
  45.  
  46. # install mysql
  47. cd /source
  48. yum install mysql-community-release-el7-5.noarch.rpm
  49. rm mysql-community-release-el7-5.noarch.rpm
  50. yum install mysql-community-server
  51.  
  52. # install php
  53. cd /source/php-`${PHP_VER}`
  54. ./configure --enable-fileinfo --enable-bcmath --enable-libxml --enable-mbstring --enable-pdo --with-curl --with-gd \
  55.    --with-gettext --without-mysql --with-mysqli --with-mysql-sock --with-pcre-regex --with-pdo-mysql --with-openssl \
  56.    --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-scan-dir=/usr/local/lib/php
  57. make
  58. make install
  59.  
  60. # install phpunit
  61. wget https://phar.phpunit.de/phpunit.phar -O /usr/bin/phpunit
  62. chmod a+x /usr/bin/phpunit
  63.  
  64. # install xdebug
  65. cd /source/xdebug-`${XDEBUG_VER}`
  66. phpize
  67. ./configure
  68. make
  69. cp modules/xdebug.so /usr/local/lib/php/extensions/
  70. echo "zend_extension = /usr/local/lib/php/extensions/xdebug.so" >> /usr/local/lib/php/xdebug.ini
  71.  
  72. popd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement