Upgrade PHP to 5.6 under CentOS

Source: Internet
Author: User

Today is just empty to upgrade the PHP environment to version 5.6, first of all, my environment is the source code package compiled LNMP environment

First to the PHP official website to download a php5.6 tar package, put on top of the machine, start the installation, before installing the nginx,mysql,php-fpm are turned off,

Then delete or rename the/usr/local/php directory.

>Tar-ZXF php-5.6.8.Tar. GZ>CD php-5.6.8>./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config-- With-pdo-mysql=/usr/local/mysql--with-iconv-dir--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/USR--enable-xml--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl-- Enable-mbregex--enable-fpm--enable-mbstring--with-mcrypt--enable-FTP--WITH-GD--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-Zip--enable-soap--without-pear--with-gettext# #编译完成后, start the installation> Makezend_extra_libs='-liconv'> Make Install

When the installation is complete, it's almost ready, then copy the configuration file.

>cp php.ini-production/usr/local/php/etc/php.ini>cp /usr/local/php/etc/ Php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf

Will/usr/local/php/etc/php-fpm.conf edited into the following PID=/usr/local/php/var/run/php-Fpm.piderror_log=/usr/local/php/var/log/php-Fpm.loglog_level=Notice[www]listen=/tmp/php-Cgi.socklisten.backlog= -1listen.allowed_clients=127.0.0.1Listen.owner=Wwwlisten.group=Wwwlisten.mode=0666User=Wwwgroup=wwwpm=Dynamicpm.max_children= -pm.start_servers=2pm.min_spare_servers=1pm.max_spare_servers=6Request_terminate_timeout= -Request_slowlog_timeout=0Slowlog= var/log/Slow.log//The configuration in Nginx also corresponds to the matching line.Location ~ [^/]\.php (/|$) {
Try_files $uri =404; Fastcgi_pass Unix:/tmp/php-Cgi.sock;
Fastcgi_index index.php; Include fastcgi.conf; }

Restart each service, OK

Upgrade PHP to 5.6 under CentOS

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.