sudo apt-get install build-essential gcc g++ autoconf libiconv-hook-dev libmcrypt-dev libxml2-dev libmysqlclient-dev libc Url4-openssl-dev Libjpeg8-dev Libpng12-dev Libfreetype6-dev
./configure--prefix=/usr/local/php--with-config-file-path=/etc/php--enable-fpm--enable-pcntl--enable-mysqlnd-- Enable-opcache--enable-sockets--enable-sysvmsg--enable-sysvsem --enable-sysvshm--enable-shmop--enable-zip- -enable-ftp--enable-soap--enable-xml--enable-mbstring--disable-rpath--disable-debug--disable-fileinfo-- With-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-pcre-regex--with-iconv--with-zlib-- With-mcrypt--with-gd--with-openssl--with-mhash--with-xmlrpc--with-curl--with-imap-sslsudo Makesudo make Installsudo CP php.ini-development/etc/php/
Export Path=/usr/local/php/bin:$PATHexport path=/usr/local/php/sbin:$PATH
~/.bashrc
PHP5 Source Installation