1.在pecl.php.net/package/memcache选择相应想要下载的memcache版本。
2.安装PHP的memcache扩展
#tarvxzfmemcache-2.2.6.tgz
#cdmemcache-2.2.6
#/usr/local/php/bin/phpize
#./configure--enable-memcache--with-php-config=/usr/local/php/bin/php-config--with-zlib-dir
#make
#makeinstall
安装完后,会在/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/里生成一个memcache.so
接下来修改php.ini
extension_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626"
extension=memcache.so
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@nginx配置##########################################
####413RequestEntityTooLarge(请求实体过大)######nginx.conf文件
http{
includemime.types;
default_typeapplication/octet-stream;
client_max_body_size20m;
#log_formatmain''$remote_addr-$remote_user[$time_local]"$request"''
#''$status$body_bytes_sent"$http_referer"''
#''"$http_user_agent""$http_x_forwarded_for"'';
#access_loglogs/access.logmain;
sendfileon;
#tcp_nopushon;
#keepalive_timeout0;
keepalive_timeout65;
#gzipon
server{
listen80;
server_nameapi.linshou.com;
root/home/www/2bi/wwwroot;
indexindex.phpindex.htmlindex.htm;
charsetutf-8;
location~^/(images|javascript|js|css|flash|media|static)/{
expires30d;
log_not_foundoff;
}
#禁止访问目录
location~^/home/{
denyall;
}
#后台管理
location/admin{
if(-f$request_filename){
break;
}
if(-d$request_filename){
break;
}
rewrite^(.+)$/admin/index.phplast;
}
#将request指向index.php
location/{
if(-f$request_filename){
break;
}
if(-d$request_filename){
break;
}
rewrite^(.+)$/index.phplast;
}
#引用PHPCGI
location~.\.(php|php5)?${
fastcgi_pass127.0.0.1:9000;
includefastcgi_params;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
fastcgi_read_timeout600;
}
}
#零售官网
server{
listen80;
server_namewww.linshou.com;
root/home/www/2bi/wwwroot/home;
indexindex.phpindex.htmindex.html;
charsetutf-8;
location/{
if(-f$request_filename){
break;
}
if(-d$request_filename){
break;
}
rewrite^(.+)$/index.phplast;
}
#引用PHPCGI
location~.\.(php|php5)?${
fastcgi_pass127.0.0.1:9000;
includefastcgi_params;
fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
fastcgi_read_timeout600;
}
}
}
/////php.ini////////////
413RequestEntityTooLarge
增大client_max_body_size
client_max_body_size:指令指定允许客户端连接的最大请求实体大小,它出现在请求头部的Content-Length字段.
如果请求大于指定的值,客户端将收到一个"RequestEntityTooLarge"(413)错误.记住,浏览器并不知道怎样显示这个错误.
php.ini中增大
post_max_size
upload_max_filesize
################################
一。----------------安装lrzsz----------------华丽分割线---------------------------------------------------
#yum-yinstalllrzsz
使用rz、sz命令上传、下载数据。
使用方法:
上传文件
#rzfilename
下载文件
#szfilename
重启php
cd/usr/local/php/sbin/php-fpm#进入目录
killallphp-fpm#关闭
./php-fpm#开启
重启nginx:/usr/local/nginx/sbin/nginx-sreload |
|