Compiling and installing PHP7

Source: Internet
Author: User
Tags fpm mcrypt

CentOS6.6 Compiling and installing PHP7
    • Install the dependency package first
Yum install gcc gcc-c++ pcre* openssl* gd-devel* zlib-devel pcre-devel libxml2-devel curl-devel

  

Download and install Libmcrypt

Address: http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/

Compile and install

TAR-ZXVF libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configuremake && make install

Edit/etc/ld.so.conf last line add

/usr/local/lib

  

    • Download PHP7
wget http://cn2.php.net/distributions/php-7.0.1.tar.gztar zxvf php-7.0. 1. tar.gz
    • Compiling and installing PHP7
./Configure--prefix=/usr/local/PHP7--exec-prefix=/usr/local/PHP7--bindir=/usr/local/php7/bin--sbindir=/usr/local/php7/Sbin--includedir=/usr/local/php7/include--libdir=/usr/local/php7/lib/PHP--mandir=/usr/local/php7/php/Mans--with-config-file-path=/usr/local/php7/etc--with-mcrypt=/usr/include--with-Mhash--with-OpenSSL--with-mysqli=Shared,mysqlnd--with-pdo-mysql=Shared,mysqlnd--with-GD--with-Iconv--with-zlib--enable-Zip--enable-inline-optimization--disable-Debug--disable-rpath--enable-shared--enable-XML--enable-Bcmath--enable-Shmop--enable-Sysvsem--enable-Mbregex--enable-mbstring--enable-FTP--enable-gd-native-TTF--enable-Pcntl--enable-Sockets--with-Xmlrpc--enable-Soap--without-Pear--with-GetText--enable-Session--with-Curl--with-jpeg-dir--with-freetype-dir--enable-Opcache--enable-FPM--without-gdbm--disable-fileinfo
View Code
Make && make install
    • Configuration file
cp/usr/local/php7/etc/php-fpm.conf.default/usr/local/php7/etc/php-fpm.confcp/usr/local/php7/etc/php-fpm.d/ www.conf.default/usr/local/php7/etc/php-fpm.d/www.conf CP PHP.INI-PRODUCTION/USR/LOCAL/PHP/ETC/PHP.INICP SAPI/FPM /init.d.php-fpm/etc/rc.d/init.d/php-fpmchmod +x/etc/rc.d/init.d/php-fpmchkconfig--add php-fpmchkconfig php-fpm on
    • Start
/ETC/INIT.D/PHP-FPM start
    • Nginx Link php

Cat/etc/nginx/nginx.conf

User Nginx;worker_processes1; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream; Log_format Main'$remote _addr-$remote _user [$time _local] "$request"'                     '$status $body _bytes_sent "$http _referer"'                      '"$http _user_agent" "$http _x_forwarded_for "'; # Access_log Logs/Access.log main;server_names_hash_bucket_size -; client_header_buffer_size 32k;large_client_header_buffers432k;client_max_body_size 300m;sendfile On;tcp_nopush on;fastcgi_connect_timeout -; Fastcgi_send_timeout -; Fastcgi_read_timeout -; fastcgi_buffer_size 64k;fastcgi_buffers464k;fastcgi_busy_buffers_size 128k;fastcgi_temp_file_write_size 128k;keepalive_timeout -; tcp_nodelay on;server_tokens off;gzip on;gzip_min_length 1k;gzip_buffers416k;gzip_http_version1.1; Gzip_comp_level2; gzip_types text/plain Application/x-javascript text/css application/xml;gzip_vary on; server {Listen the;        server_name www.qy.com; #access_log logs/Host.access.log Main; Location/{root HTML;        Index index.html index.htm; } error_page - 502 503 504/50x.html; Location= /50x.html {root html; }}include/etc/nginx/vhost/*. conf;}
View Code

Cat/etc/nginx/vhost/zabbix.conf

Server {Listen the; server_name192.168.80.11; Index index.php index.html index.htmdefault. htmldefault. htmdefault. php; Root/usr/local/nginx/html; Location~\.php$ {root/usr/local/nginx/html; Fastcgi_pass192.168.80.11:9000;        Fastcgi_index index.php; Fastcgi_param Script_filename/usr/local/nginx/html/$fastcgi _script_name; Include Fastcgi_params; } Location/status {stub_status on;                Access_log off; } Location~ .*\. (gif|jpg|jpeg|png|bmp|swf) $ {expires 30d; } Location~ .*\. (JS|CSS)?$ {Expires 12h;                                    } Access_log off; }
View Code

Compiling and installing PHP7

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.