標籤: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