memcache php mysql_linux+Nginx+Memcache+Mysql+php 服务器 安装配置开发笔记(一)

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;

}

}

#零售官网

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:指令指定允许客户端连接的最大请求实体大小,它出现在请求头部的Content-Length字段.

如果请求大于指定的值,客户端将收到一个"Request Entity Too Large" (413)错误. 记住,浏览器并不知道怎样显示这个错误.

php.ini中增大

post_max_size

upload_max_filesize

################################

一。----------------安装lrzsz----------------华丽分割线---------------------------------------------------

#yum -y install lrzsz

使用rz、sz命令上传、下载数据。

使用方法:

上传文件

# rz filename

下载文件

# sz filename

重启php

cd /usr/local/php/sbin/php-fpm#进入目录

killall php-fpm #关闭

./php-fpm #开启

重启 nginx:/usr/local/nginx/sbin/nginx -s reload

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值