This article describes how to install php7 + nginx environment under centos6.6. Share with you for your reference, the details are as follows: 1. Install necessary dependency libraries
2. Download the PHP source package http://php.net/downloads.php The file name is: php-7.0.4.tar.gz 3. Unzip the source package > tar -zxvf php-7.0.4.tar.gz 4. Enter the directory and configure ./configure --prefix=/data/nmp/php \ --with-curl \ --with-freetype-dir \ --with-gd \ --with-gettext \ --with-iconv-dir \ --with-kerberos \ --with-libdir=lib \ --with-libxml-dir \ --with-mysqli=mysqlnd \ --with-openssl \ --with-pcre-regex \ --with-pdo-mysql=mysqlnd \ --with-pdo-sqlite \ --with-pear \ --with-png-dir \ --with-xmlrpc \ --with-xsl \ --with-zlib \ --enable-mysqlnd \ --enable-fpm \ --enable-bcmath \ --enable-libxml \ --enable-inline-optimization \ --enable-gd-native-ttf \ --enable-mbregex \ --enable-mbstring \ --enable-opcache \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvsem \ --enable-xml \ --enable-zip \ --enable-pthreads \ --enable-maintainer-zts \ --enable-fileinfo 5. make && make install > make && make install 6. Configuration File > cp php.ini-development /data/nmp/php/lib/php.ini > cp /data/nmp/php/etc/php-fpm.conf.default /data/nmp/php/etc/php-fpm.conf > cp /data/nmp/php/etc/php-fpm.d/www.conf.default /data/nmp/php/etc/php-fpm.d/www.conf > cp -R ./sapi/fpm/php-fpm /data/nmp/php/etc/init.d/php-fpm (*Need to create init.d directory) 7. Startup > /data/nmp/php/etc/init.d/php-fpm 8. Nginx integration with PHP >vi /data/nmp/nginx/conf/nginx.conf server { listen 80; server_name localhost; charset utf-8; #root website directory location / { root /data/wwwroot; index index.html index.htm index.php; } location ~ \.php$ { #Website directory root /data/wwwroot; #phpcgi port, default 9000 fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #document_root points to the website directory fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 9. Reload nginx > /data/nmp/nginx/sbin/nginx -s reload I hope this article will help you configure your CentOS environment. You may also be interested in:
|
<<: MySQL quickly obtains the table instance code without primary key in the library
>>: Bootstrap+Jquery to achieve calendar effect
CentOS 8 has been released for a long time. As so...
Intro Previously, our docker images were stored i...
Table of contents Application scenarios: Method 1...
Pre-installation preparation The main purpose of ...
When installing a virtual machine, a prompt appea...
Table of contents In JavaScript , there are sever...
While the paperless world has not yet emerged, mo...
A few days ago, I watched a video of a foreign gu...
function 0. Display current time Command: select ...
Since PHP7 came out, as a fan of the latest versi...
When the jsp that is jumped to after the struts2 a...
Download Download address: https://dev.mysql.com/...
Table of contents 1. What is a hook? 2. Why does ...
1. Command Introduction The chkconfig command is ...
Part of the code: Copy code The code is as follow...