1.在pecl.php.net/package/memcache 選擇相應想要下載的memcache版本。
2.安裝PHP的memcache擴展
#tar vxzf memcache-2.2.6.tgz
# cd memcache-2.2.6
# /usr/local/php/bin/phpize
# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
# make
# make install
安裝完后,會在/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配置##########################################
####413 Request Entity Too Large( 請求實體過大)######nginx.conf 文件
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 20m;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on
server {
listen 80;
server_name api.linshou.com;
root /home/www/2bi/wwwroot;
index index.php index.html index.htm;
charset utf-8;
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
expires 30d;
log_not_found off;
}
#禁止訪問目錄
location ~ ^/home/ {
deny all;
}
#后臺管理
location /admin {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /admin/index.php last;
}
#將request指向index.php
location / {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php last;
}
#引用PHP CGI
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
}
}
#零售官網(wǎng)
server {
listen 80;
server_name www.linshou.com;
root /home/www/2bi/wwwroot/home;
index index.php index.htm index.html;
charset utf-8;
location / {
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php last;
}
#引用PHP CGI
location ~ .*\.(php|php5)?$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
}
}
}
/////************************php.ini ////////////
413 Request Entity Too Large
增大client_max_body_size
client_max_body_size:指令指定允許客戶端連接的最大請求實體大小,它出現(xiàn)在請求頭部的Content-Length字段.
如果請求大于指定的值,客戶端將收到一個"Request Entity Too Large" (413)錯誤. 記住,瀏覽器并不知道怎樣顯示這個錯誤.
php.ini中增大
post_max_size
upload_max_filesize
################################
一。----------------安裝lrzsz----------------華麗分割線---------------------------------------------------
#yum -y install lrzsz
使用rz、sz命令上傳、下載數(shù)據(jù)。
使用方法:
上傳文件
# rz filename
下載文件
# sz filename
重啟php
cd /usr/local/php/sbin/php-fpm#進入目錄
killall php-fpm #關(guān)閉
./php-fpm #開啟
重啟 nginx:/usr/local/nginx/sbin/nginx -s reload