Last active
October 1, 2019 20:38
-
-
Save meeuw/73ff3ede76a89d6164e6 to your computer and use it in GitHub Desktop.
build php 5.2.10 on centos 6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| rpm -U http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm | |
| rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 | |
| yum update -y | |
| yum install -y gcc wget tar gzip nasm zlib-devel perl ncurses-devel gcc-c++ libxml2-devel libmcrypt-devel bzip2-devel curl-devel libtidy-devel httpd-devel libtool-ltdl-devel mysql-server | |
| # build freetype | |
| mkdir -p /opt/php-5.2.10/freetype-2.6/src/ | |
| cd /opt/php-5.2.10/freetype-2.6/src/ | |
| wget http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz | |
| tar xzf freetype-2.6.tar.gz | |
| cd /opt/php-5.2.10/freetype-2.6/src/freetype-2.6/ | |
| ./configure --prefix=/opt/php-5.2.10/freetype-2.6/ | |
| make -j4 | |
| make install | |
| cd /opt/php-5.2.10/freetype-2.6/ | |
| ln -s lib lib64 | |
| cd /opt/php-5.2.10/freetype-2.6/include/freetype2/ | |
| ln -s . freetype | |
| # build libjpeg-turbo | |
| mkdir -p /opt/php-5.2.10/libjpeg-turbo-1.4.2/src | |
| cd /opt/php-5.2.10/libjpeg-turbo-1.4.2/src | |
| wget http://downloads.sourceforge.net/project/libjpeg-turbo/1.4.2/libjpeg-turbo-1.4.2.tar.gz | |
| tar xzf libjpeg-turbo-1.4.2.tar.gz | |
| cd /opt/php-5.2.10/libjpeg-turbo-1.4.2/src/libjpeg-turbo-1.4.2 | |
| ./configure --prefix=/opt/php-5.2.10/libjpeg-turbo-1.4.2/ | |
| make -j4 | |
| make install | |
| cd /opt/php-5.2.10/libjpeg-turbo-1.4.2/ | |
| ln -s lib lib64 | |
| # build libpng | |
| mkdir -p /opt/php-5.2.10/libpng-1.6.20/src | |
| cd /opt/php-5.2.10/libpng-1.6.20/src | |
| wget http://downloads.sourceforge.net/project/libpng/libpng16/1.6.20/libpng-1.6.20.tar.gz | |
| tar xzf libpng-1.6.20.tar.gz | |
| cd /opt/php-5.2.10/libpng-1.6.20/src/libpng-1.6.20/ | |
| ./configure --prefix=/opt/php-5.2.10/libpng-1.6.20 | |
| make -j4 | |
| make install | |
| cd /opt/php-5.2.10/libpng-1.6.20/ | |
| ln -s lib lib64 | |
| # build openssl | |
| mkdir -p /opt/php-5.2.10/openssl-0.9.8zg/src | |
| cd /opt/php-5.2.10/openssl-0.9.8zg/src | |
| wget https://www.openssl.org/source/openssl-0.9.8zg.tar.gz | |
| tar xzf openssl-0.9.8zg.tar.gz | |
| cd /opt/php-5.2.10/openssl-0.9.8zg/src/openssl-0.9.8zg/ | |
| ./config --prefix=/opt/php-5.2.10/openssl-0.9.8zg/ shared | |
| make -j4 | |
| make install | |
| cd /opt/php-5.2.10/openssl-0.9.8zg/ | |
| ln -s lib lib64 | |
| # build mysql | |
| mkdir -p /opt/php-5.2.10/mysql-5.1.73/src | |
| cd /opt/php-5.2.10/mysql-5.1.73/src | |
| wget http://cdn.mysql.com/Downloads/MySQL-5.1/mysql-5.1.73.tar.gz | |
| tar xzf mysql-5.1.73.tar.gz | |
| cd /opt/php-5.2.10/mysql-5.1.73/src/mysql-5.1.73/ | |
| ./configure --prefix=/opt/php-5.2.10/mysql-5.1.73 | |
| make -j4 | |
| make install | |
| cd /opt/php-5.2.10/mysql-5.1.73/ | |
| ln -s lib lib64 | |
| # build php | |
| mkdir -p /opt/php-5.2.10/php-5.2.10/src | |
| cd /opt/php-5.2.10/php-5.2.10/src | |
| wget -c http://museum.php.net/php5/php-5.2.10.tar.gz | |
| tar xzf php-5.2.10.tar.gz | |
| cd /opt/php-5.2.10/php-5.2.10/src/php-5.2.10/ | |
| export PATH=$PATH:/opt/php-5.2.10/mysql-5.1.73/bin | |
| ./configure --with-apxs2 --with-mysql=/opt/php-5.2.10/mysql-5.1.73 --with-mysqli --with-gd --with-freetype-dir=/opt/php-5.2.10/freetype-2.6 --with-jpeg-dir=/opt/php-5.2.10/libjpeg-turbo-1.4.2/ --with-ttf=/usr/local/lib --with-zlib-dir=/usr/local --with-png-dir=/opt/php-5.2.10/libpng-1.6.20 --enable-inline-optimization --with-openssl=/opt/php-5.2.10/openssl-0.9.8zg/ --with-bz2 --enable-ftp --enable-mbstring --with-gettext --with-zlib --enable-sockets --with-curl --with-mcrypt --enable-soap --with-pdo-mysql=/opt/php-5.2.10/mysql-5.1.73 --with-tidy --with-libdir=lib64 --prefix=/opt/php-5.2.10/php-5.2.10 | |
| make -j4 | |
| make install | |
| cat > /etc/httpd/conf.d/php.conf << @EOF | |
| AddType text/html .php | |
| DirectoryIndex index.php | |
| <FilesMatch \.php\$> | |
| SetHandler application/x-httpd-php | |
| </FilesMatch> | |
| php_value session.save_handler "files" | |
| php_value session.save_path "/var/lib/php/session" | |
| php_value soap.wsdl_cache_dir "/var/lib/php/wsdlcache" | |
| @EOF | |
| mkdir -p /var/lib/php/session /var/lib/php/wsdlcache | |
| chown -R apache:apache /var/lib/php/session /var/lib/php/wsdlcache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment