CentOS Deployment Php+nginx+memadmin + memcached

Source: Internet
Author: User
Tags fpm

Nginx

Http://nginx.org/download/nginx-1.7.3.tar.gz

Php

Http://cn2.php.net/distributions/php-5.5.14.tar.gz

Php.memcache Plug-in

Http://pecl.php.net/get/memcache-3.0.8.tgz

Memadmin

Http://www.junopen.com/memadmin/memadmin-1.0.12.tar.gz



Install Nginx

TAR-ZXF nginx-1.7.3

CD nginx-1.7.3

./configure--prefix=/opt/nginx

Make

Make install


Install PHP

TAR-ZXF php-5.5.14

CD php-5.5.14

./configure--prefix=/opt/php--enable-fastcgi--enable-zend-multibyte--enable-zip--enable-discard-path-- Enable-force-cgi-redirect--with-libxml-dir--with-curl--with-openssl=/opt/openssl-1.0.1h--with-zlib-- Enable-mbstring--with-gd--with-mcrypt--enable-exif--enable-fpm--enable-force-cgi-redirect--enable-pdo-- With-ttf--with-iconv--enable-xml--with-gd--with-jpeg-dir=/usr/local/--with-png-dir=/usr/local-- with-freetype-dir=/usr/include/freetype2/

If you do not have the following

Openssl-1.0.1h specifying the installation to the/OPT/OPENSSL-1.0.1H directory

Http://www.openssl.org/source/openssl-1.0.1h.tar.gz

Freetype2

Http://download.savannah.gnu.org/releases/freetype/freetype-doc-2.5.3.tar.gz

Download and install Yourself


Memadmin Extract to Directory/var/www/html/

TAR-ZXF memadmin-1.0.12.tar.gz

MV Memadmin-1.0.12/var/www/html


Php.memcache Install

TAR-ZXF memcache-3.0.8.tgz

CD memcache-3.0.8.tgz

/opt/php/bin/phpize

./configure--with-php-config=/opt/php/bin/php-config--enable-memcache--with-zilib-dir


Configure php.ini file (do not know memcache.so path, command: Find-name memcache.so)

If/opt/php/etc/php.ini did not

CP ~/php-5.5.14/php.ini-devlopment/opt/php/etc


Vim/opt/php/etc/php.ini

Extension_dir=/opt/php/lib/php/extensions/no-debug-non-zts-20121212/memcache.so

Extension=memcache.so

include_path = ".:/ Opt/php/lib:/opt/php/etc "


Configuring the Php-fpm.conf File

PID = Run/php-fpm.pid

Error_log = Log/php-fpm.log

Log_level = Notice

user = Memadmin (custom user name, cannot use root account)

Group = memadmin (custom user name, cannot use root account)

Listen = 127.0.0.1:8999 (default = 9000, make sure no one is occupied)

Env[hostname] = $HOSTNAME

Env[path] =/usr/local/bin:/usr/bin:/bin

ENV[TMP] =/tmp

ENV[TMPDIR] =/tmp

ENV[TEMP] =/tmp


Start PHP-FPM

/opt/php/sbin/php-fpm

Close PHP-FPM

Ps-aux|grep PHP

Kill-9 23455


See if Php-memcache is installed properly

/opt/php/bin/php-m


Configure/opt/nginx/conf

Vim/opt/nginx/conf/nginx.conf

In the first article join

User memadmin; (consistent with user in php-fpm.conf)

Location ~ \.php$ {

root/var/www/html/;

Fastcgi_pass 127.0.0.1:8999;

Fastcgi_index index.php;

Fastcgi_param script_filename $document _root$fastcgi_script_name; #/scripts$fastcgi_script_name;

Include Fastcgi_params;

}

Start

/opt/nginx/sbin/nginx

Shut down

/opt/nginx/sbin/nginx-s stop


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.