CENTOS65 Installing Nginx and PHP

Source: Internet
Author: User

Yum-y install gcc automake autoconf libtool make CMake

Yum-y install gcc gcc-c++ glibc glibc-devel
Yum-y Install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-deve L LIBXML2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses Ncurses-devel Curl C Url-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel

Tar-xvzf php-5.6.13.tar.gz
CD php-5.6.13

./configure--prefix=/usr/local/php --enable-fpm--with-mcrypt--enable-mbstring--disable-pdo--with-curl- -disable-debug --disable-rpath--enable-inline-optimization--with-bz2 --with-zlib--enable-sockets-- Enable-sysvsem--enable-sysvshm--enable-pcntl--enable-mbregex--with-mhash--enable-zip--with-pcre-regex-- With-mysql--with-mysqli--with-gd--with-jpeg-dir
Make
do test
make install
cd/usr/local/php/
CD/ usr/local/php/etc/
CP php-fpm.conf.default php-fpm.conf
Vim php-fpm.conf
Run PHP-FPM
/usr/local/php/ SBIN/PHP-FPM can be

CD
Tar-xvzf pcre-8.36.tar.gz
tar-xvzf openssl-1.0.2a.tar.gz
tar-xvzf zlib-1.2.8.tar.gz
Tar nginx-1 .9.0.tar.gz
CD nginx-1.9.0
./configure --prefix=/usr/local/nginx --with-stream -- with-stream_ssl_module --with-pcre=/root/pcre-8.36 --with-zlib=/root/zlib-1.2.8 --with-openssl= /root/openssl-1.0.2a --with-http_ssl_module--with-http_sub_module --with-http_realip_module -- With-http_stub_status_module--with-http_sub_module

In/usr/local/nginx/conf/nginx.conf
Location ~ \.php$ {
root HTML;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}

Create a new t.php under/usr/local/nginx/html/
Cat t.php
<?php
Phpinfo ();
?>

http://192.168.11.110/t.php

CENTOS65 Installing Nginx and PHP

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.