Archive for April 26th, 2010

php的session_start函数会附加header信息

Session_start会添加下面这些东西,所以你如果要改这些 header请在Session_start之后修改,否则会被session_start overwrite掉!

Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires Thu, 19 Nov 1981 08:52:00 GMT
Pragma no-cache

No Comments

php unset Header..

如果php已经输出了header

在下面只需要header(‘Pragma:’);就可以了。。

注意最后有一个:

php 5.3.0以后提供了header_remove这个函数,比上面的方法好多了!但是美中不足的是只有5.3.0以后才能用拉~~

No Comments

PKCS5填充 PHP DES算法库

  1. class Bdes extends CBase {
  2.  private $key; //密码
  3.  private $iv; //iv
  4.  private $mcrypt;
  5.  private $blockSize;
  6.  <a href="http://blog.fabrichina.net/archives/201#more-201" class="more-link">Read the rest of this entry &raquo;</a>

No Comments

我常用的一种nginx conf文件的写法

user  www www;
worker_processes 10;
error_log  /var/nginxlogs/error.log error;
worker_rlimit_nofile 21200;
events
{
       use epoll;
       worker_connections 21200;
}
http {
      upstream javaServer {
          server 10.10.10.81:7777;
          server 10.10.10.80:7777;
          server 10.10.10.81:7777;
      }
      upstream phpServer {
          server localhost:81;
      }
      upstream cacheServer {
          server localhost:82;
      }
      include  mime.types;
      default_type  application/octet-stream;
      server_tokens off;
      client_max_body_size 20m;
      tcp_nodelay on;
      include dhport.conf;
#      include cache.dhport.conf;
}

No Comments

apache vs php httpd.conf初始设置

LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php

<Directory />
 options FollowSymLinks
 AllowOverride all
 Order allow,deny
 Allow from all
</Directory>
AddDefaultCharset utf-8

这样定虚机的时候能省事多了~~

No Comments