存档
今天编译memcache扩展,由于从别的机器拷过来的,忘记make clean,出了点插曲,备忘下
cd memcache-2.2.5
/usr/local/bin/phpize
make clean
./configure –enable-memcache –with-php-config=/usr/local/bin/php-config –with-zlib-dir
make
make install
编译后会生成memcache.so
例如我的是:
/usr/local/lib/php/extensions/no-debug-non-zts-20060613/
修改php.ini
将extension_dir改为以上目录或将生成的so文件移至extension目录
添加行
extension=memcache.so
今天一同事问我,他用了Content-Type=text/xml型,提交了一个xml文档内容给了php server,要怎么获得这个POST数据。
这把我愣住了,以前确实没写过这样的POST,赶紧查手册,发现有$HTTP_RAW_POST_DATA 这一项。对此的解释是:The RAW / uninterpreted HTTP POST information can be accessed with: $GLOBALS['HTTP_RAW_POST_DATA'] This is useful in cases where the post Content-Type is not something PHP understands (such as text/xml).
意思是,由于PHP默认只识别application/x-www.form-urlencoded标准的数据类型,因此,对型如text/xml的内容无法解析为$_POST数组,故保留原型,交给$HTTP_RAW_POST_DAT来接收。
获取用户IP地址的几个属性的区别(HTTP_X_FORWARDED_FOR,HTTP_X_FORWARDED,HTTP_VIA,REMOTE_ADDR)
最新评论