Skip to content

Instantly share code, notes, and snippets.

@bajramemini
Forked from stayallive/install.sh
Last active August 29, 2015 14:11
Show Gist options
  • Save bajramemini/de2f28dbb6b0352b9fcc to your computer and use it in GitHub Desktop.
Save bajramemini/de2f28dbb6b0352b9fcc to your computer and use it in GitHub Desktop.

Revisions

  1. @stayallive stayallive revised this gist Jul 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -85,7 +85,7 @@ cd /php/php-5.5.15
    --without-pdo-sqlite \
    --with-config-file-scan-dir=/php/php-5.5.15/php.d \
    --without-sqlite3 \
    --enable-intl
    --enable-intl \
    --enable-opcache

    # Build & Install
  2. @stayallive stayallive revised this gist Jul 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    # Make sure you are up to date
    yum update && yum -y install wget
    yum -y update && yum -y install wget

    # Install EPEL repository
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  3. @stayallive stayallive revised this gist Jul 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ yum update && yum -y install wget
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    # Get us a clean working directory
    makedir /php
    mkdir /php
    cd /php

    # Install PHP dependencies
  4. @stayallive stayallive revised this gist Jul 28, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -18,13 +18,13 @@ yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-
    mysql-devel readline-devel libedit-devel recode-devel libtidy-devel libtool-ltdl-devel

    # Download PHP
    wget http://nl1.php.net/get/php-5.5.15.tar.gz/from/this/mirror -O /usr/local/src/php-5.5.15.tar.gz
    wget http://nl1.php.net/get/php-5.5.15.tar.gz/from/this/mirror -O /php/php-5.5.15.tar.gz

    # Extract PHP
    tar xzvf /usr/local/src/php-5.5.15.tar.gz
    tar xzvf /php/php-5.5.15.tar.gz

    # Move to unpacked folder
    cd php-5.5.15
    cd /php/php-5.5.15

    # Configure PHP build script
    ./configure \
  5. @stayallive stayallive renamed this gist Jul 28, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.sh → install.sh
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,13 @@
    #!/bin/bash

    # Make sure you are up to date
    yum update && yum -y install wget

    # Install EPEL repository
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    # Get us a clean working directory
    makdir /php
    makedir /php
    cd /php

    # Install PHP dependencies
  6. @stayallive stayallive created this gist Jul 28, 2014.
    107 changes: 107 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,107 @@
    # Make sure you are up to date
    yum update && yum -y install wget

    # Install EPEL repository
    rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    # Get us a clean working directory
    makdir /php
    cd /php

    # Install PHP dependencies
    yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel \
    bzip2-devel libjpeg-devel libpng-devel freetype-devel openldap-devel postgresql-devel \
    aspell-devel net-snmp-devel libxslt-devel libc-client-devel libicu-devel gmp-devel curl-devel \
    libmcrypt-devel unixODBC-devel pcre-devel sqlite-devel db4-devel enchant-devel libXpm-devel \
    mysql-devel readline-devel libedit-devel recode-devel libtidy-devel libtool-ltdl-devel

    # Download PHP
    wget http://nl1.php.net/get/php-5.5.15.tar.gz/from/this/mirror -O /usr/local/src/php-5.5.15.tar.gz

    # Extract PHP
    tar xzvf /usr/local/src/php-5.5.15.tar.gz

    # Move to unpacked folder
    cd php-5.5.15

    # Configure PHP build script
    ./configure \
    --with-libdir=lib64 \
    --cache-file=./config.cache \
    --prefix=/php/php-5.5.15 \
    --with-config-file-path=/php/php-5.5.15/etc \
    --disable-debug \
    --with-pic \
    --disable-rpath \
    --with-bz2 \
    --with-curl \
    --with-freetype-dir=/php/php-5.5.15 \
    --with-png-dir=/php/php-5.5.15 \
    --enable-gd-native-ttf \
    --without-gdbm \
    --with-gettext \
    --with-gmp \
    --with-iconv \
    --with-jpeg-dir=/php/php-5.5.15 \
    --with-openssl \
    --with-pspell \
    --with-pcre-regex \
    --with-zlib \
    --enable-exif \
    --enable-ftp \
    --enable-sockets \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-sysvmsg \
    --enable-wddx \
    --with-kerberos \
    --with-unixODBC=/usr \
    --enable-shmop \
    --enable-calendar \
    --with-libxml-dir=/php/php-5.5.15 \
    --enable-pcntl \
    --with-imap \
    --with-imap-ssl \
    --enable-mbstring \
    --enable-mbregex \
    --with-gd \
    --enable-bcmath \
    --with-xmlrpc \
    --with-ldap \
    --with-ldap-sasl \
    --with-mysql=/usr \
    --with-mysqli \
    --with-snmp \
    --enable-soap \
    --with-xsl \
    --enable-xmlreader \
    --enable-xmlwriter \
    --enable-pdo \
    --with-pdo-mysql \
    --with-pear=/php/php-5.5.15/pear \
    --with-mcrypt \
    --without-pdo-sqlite \
    --with-config-file-scan-dir=/php/php-5.5.15/php.d \
    --without-sqlite3 \
    --enable-intl
    --enable-opcache

    # Build & Install
    make && make install

    # Create a default php.ini
    mkdir /php/php-5.5.15/etc
    cp -a /etc/php.ini /php/php-5.5.15/etc/php.ini

    # Set the timezone
    timezone=$(grep -oP '(?<=")\w+/\w+' /etc/sysconfig/clock)
    sed -i "s#;date.timezone =#date.timezone = $timezone#" /php/php-5.5.15/etc/php.ini

    # Register with Plesk
    /usr/local/psa/bin/php_handler \
    --add \
    -displayname "5.5.15" \
    -path /php/php-5.5.15/bin/php-cgi \
    -phpini /php/php-5.5.15/etc/php.ini \
    -type fastcgi \
    -id "fastcgi-5.5.15"