码迷,mamicode.com
首页 > Web开发 > 详细

centos 部署php+nginx+memadmin + memcached

时间:2014-07-25 00:03:54      阅读:429      评论:0      收藏:0      [点我收藏+]

标签:http   os   文件   io   for   re   c   html   

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插件

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/  

如果没有以下

openssl-1.0.1h 指定安装到/opt/openssl-1.0.1h目录

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

自己下载安装


memadmin解压到目录/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


配置php.ini文件(不知道memcache.so路径,命令:find -name memcache.so)

如果/opt/php/etc/php.ini没有

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"


配置php-fpm.conf文件

pid = run/php-fpm.pid

error_log = log/php-fpm.log

log_level = notice

user = memadmin(自定义用户名,不能用root账号)

group = memadmin(自定义用户名,不能用root账号)

listen = 127.0.0.1:8999(默认为9000, 确定没人占用)

env[HOSTNAME] = $HOSTNAME

env[PATH] = /usr/local/bin:/usr/bin:/bin

env[TMP] = /tmp

env[TMPDIR] = /tmp

env[TEMP] = /tmp


启动php-fpm

/opt/php/sbin/php-fpm

关闭php-fpm

ps -aux|grep php

kill -9 23455  


查看php-memcache是否安装正常

/opt/php/bin/php -m


配置/opt/nginx/conf

vim /opt/nginx/conf/nginx.conf

在第一条加入

user memadmin;(与php-fpm.conf里的user保持一致)

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;

        }  

启动

 /opt/nginx/sbin/nginx

关闭

/opt/nginx/sbin/nginx -s stop


centos 部署php+nginx+memadmin + memcached,布布扣,bubuko.com

centos 部署php+nginx+memadmin + memcached

标签:http   os   文件   io   for   re   c   html   

原文地址:http://my.oschina.net/yunnet/blog/294607

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!