Skip to content

Instantly share code, notes, and snippets.

@Amar-Chaudhari
Last active November 13, 2023 18:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Amar-Chaudhari/cceeab4e6d1a5361844bcd32dc33d954 to your computer and use it in GitHub Desktop.
Save Amar-Chaudhari/cceeab4e6d1a5361844bcd32dc33d954 to your computer and use it in GitHub Desktop.
Install PHP-5.6.22 from source

Install Requirments

yum install bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel libc-client-devel libmcrypt-devel -y

Download Package

cd /tmp
wget -O php-5.6.22.tar.gz http://pl1.php.net/get/php-5.6.22.tar.gz/from/this/mirror
tar -zxvf php-5.6.22.tar.gz
cd php-5.6.22

Compile php

./configure --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-kerberos --enable-mbstring --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-zlib-dir --with-regex --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-soap --enable-sockets --with-xmlrpc --enable-zip --with-zlib --with-imap-ssl --with-kerberos --enable-inline-optimization --enable-mbregex --enable-opcache --enable-fpm --with-libdir=lib64 --prefix=/usr/local/php
make
make install

PHP-FPM setup

cd /usr/local/php/etc
mkdir fpm.d
cp php-fpm.conf.default php-fpm.conf
@bpmnnit
Copy link

bpmnnit commented Sep 13, 2017

I have PHP 5.3.3 already installed on my Centos 6.7 system. I installed PHP 5.6.31 as mentioned above. How to use this new version of PHP now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment