Compiling and installing php5.6.2

Source: Internet
Author: User

Compiling and installing php5.6.2

1.  Preparatory work PHP Related:  libiconv, mhash, mcrypt, libmcrypt, memcache, imagemagick,  imagick# mkdir /home/download && cd /home/download# yum  install gcc pcre pcre-devel gcc-c++ autoconf libxml2 libxml2-devel  Zlib zlib-devel glibc libjpeg libjpeg-devel libpng libpng-devel glibc-devel  glib2 glib2-devel ncurses ncurses-devel curl curl-devel e2fsprogs  e2fsprogs-devel openssl openssl-devel openldap openldap-devel openldap-clients  openldap-servers  freetype freetype-devel  "Libiconv" Download libiconv 1.14  and install Libiconv  url: http://ftp.gnu.org/pub/gnu/libiconv/# wget http://ftp.gnu.org/pub/gnu/libiconv/ libiconv-1.14.tar.gz# tar zxvf libiconv-1.14.tar.gz && cd libiconv-1.14#  ./configure --prefIX=/USR/LOCAL && MAKE && MAKE INSTALL# CD&NBSP, .... "Mhash" Download  MHASH 0.9.9.9  and install url: http://sourceforge.net/projects/mhash/# wget  Http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.bz2 # tar jxvf  mhash-0.9.9.9.tar.bz2 && cd mhash-0.9.9.9# ./configure &&  MAKE && MAKE INSTALL# /SBIN/LDCONFIG# CD&NBSP, .... "Libmcrypt" Download  LIBMCRYPT 2.5.8  and install url: http://sourceforge.net/projects/mcrypt/files/ libmcrypt/# wget http://downloads.sourceforge.net/project/mcrypt/libmcrypt/2.5.8/ libmcrypt-2.5.8.tar.gz# tar zxf libmcrypt-2.5.8.tar.gz && cd  Libmcrypt-2.5.8# ./configure && make && make install# /sbin /ldconfig# cd libltdl/# ./configure --enable-ltdl-install &&&nbSP;MAKE && MAKE INSTALL# CD&NBSP, .... /.. /create system Soft Connect # ln -s /usr/local/lib/libmcrypt.* /usr/lib/# ln -s /usr/local/bin/ libmcrypt-config /usr/bin/libmcrypt-config# ln -s /usr/local/lib/libmhash.* /usr/lib/ "MCrypt" Download  MCRYPT 2.6.8  and install Myrypt url: http://sourceforge.net/projects/mcrypt/?source =dlpaz# wget http://sourceforge.net/projects/mcrypt/files/latest/download?source=dlpaz -o  mcrypt-2.6.8.tar.gz# tar zxf mcrypt-2.6.8.tar.gz && cd mcrypt-2.6.8#  ./configure && make && make install# /sbin/ldconfig#  CD&NBSP, .... 2.  Compiling and installing php# wget http://php.net/get/php-5.6.2.tar.gz/from/this/mirror -o  php-5.6.2.tar.gz# tar zxvf php-5.6.2.tar.gz && cd php-5.6.2# ./ Configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-pdo-sqlite --with-mysql=mysqlnd --with-mysqli=mysqlnd -- with-pdo-mysql=mysqlnd --with-mysql-sock --with-mcrypt --with-mhash --with-iconv-dir=/usr/ Local --with-gd --with-gettext --with-freetype-dir --with-jpeg-dir --with-png-dir  --with-libxml-dir=/usr --with-curl --with-xmlrpc --with-zlib --with-pear -- With-openssl --with-libdir --with-kerberos --enable-cgi --enable-fpm --enable-pdo  --enable-opcache --enable-mbstring --enable-gd-native-ttf --enable-xml --enable-exif  --enable-zip --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem - -enable-sysvshm --enable-shmop --enable-json --enable-bcmath --enable-calendar -- enable-ftp --enable-inline-optimization --enable-pcntl --enable-mbregex --disable-rpath#  make zend_extra_libs='-liconv ' # make install# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm# chmod  +x /etc/init.d/php-fpm# chkconfig php-fpm on          # ln -s /usr/local/php/bin/* /usr/bin/# cp /usr/local/php/etc/ php-fpm.conf.default /usr/local/php/etc/php-fpm.conf# cp php.ini-production /usr/local/php /ETC/PHP.INI# CD&NBSP, ....  3.  installation of plugins and corresponding services "memcached" # yum install memcached # echo  "/usr/bin/ Memcached -d -m 512 -l localhost -u root " >> /etc/rc.local#  memcached -d -m 512 -l localhost -u root============  PHP plugin Memcache# wget http://pecl.php.net/get/memcache -o memcache-3.0.8.tar.gz# tar  zxvf memcache-3.0.8.tar.gz && cd memcache-3.0.8/# /usr/local/php/bin/ Phpize# ./configure --enable-memcache  --with-php-config=/usr/local/php/bin/php-config#  MAKE && MAKE INSTALL# CD&NBSP, .... "ImageMagick"  # yum install imagemagick-devel============ php plug-in Imagick# wget  http://pecl.php.net/get/imagick -o imagick.tar.gz# tar zxvf imagick.tar.gz  && cd imagick-3.3.0rc1/# /usr/local/php/bin/phpize# ./configure -- with-php-config=/usr/local/php/bin/php-config# make && make install# cd  .. "Gearmand" Installation gearmand# yum -y install boost-devel# wget https://launchpad.net/ gearmand/1.0/1.0.6/+download/gearmand-1.0.6.tar.gz# tar zxvf gearmand-1.0.6.tar.gz & & cd gearmand-1.0.6# ./configure# make && make install# cd &NBSP, .... Start: # mkdir -p /usr/local/var/log# gearmand -l 127.0.0.1 -d# echo  "/usr/local/sbin/gearmand -l 127.0.0.1 -d"  >>  /etc/rc.local============ php plug-in gearman# wget http://pecl.php.net/get/gearman-0.8.0.tgz#  tar zxvf gearman-0.8.0.tgz && cd gearman-0.8.0# /usr/local/php/bin /phpize # ./configure --with-php-config=/usr/local/php/bin/php-config # make  && MAKE INSTALL# CD&NBSP, .... 4.  configuration File "PHP.ini" # vim /usr/local/php/etc/php.ini expose_php = offmax_execution_ Time = 300max_input_time = 600post_max_size = 100mdate.timezone = asia /shanghai added to end of file:extension_dir =  "/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/"  extension =  "memcache.so" extension =  "imagick.so"  extension =  " Gearman.so " zend_extension = "/usr/local/php/lib/php/extensions/no-debug-Non-zts-20131226/opcache.so " opcache.enable=1opcache.enable_cli=1opcache.memory_consumption= 128opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.save_comments=0opcache.fast_ Shutdown=1 "php-fpm.conf" # vim /usr/local/php/etc/php-fpm.confuser = wwwgroup =  wwwaccess.log = /usr/local/php/var/log/$pool .access.logaccess.format =  "%R - %u  %t \ "%m %r%q%q\"  %s %f %{mili}d %{kilo}m %c%% " slowlog =  /usr/local/php/var/log/$pool. Log.slowservice php-fpm start


Compiling and installing php5.6.2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.