易截截图软件、单文件、免安装、纯绿色、仅160KB

php 使用memcached 安装配置

 
1、安装libeven
memcached的使用需要libeven的支持,我们得先装上libeven。
官方网站:http://www.monkey.org/~provos/libevent/
libevent安装方式比较简单:
./configure && make
make install
检查是否 已经安装
 ls -l /usr/local/lib/ | grep even
2、安装memcached
官方网站:http://www.danga.com/memcached/download.bml
memcached安装需要些参数:
以下是代码片段:
./configure
make
make install
3、测试
/usr/local/bin/memcached -h
正常ok
常见错误
/usr/local/bin/memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
解决办法
LD_DEBUG=libs memcached -v
输出
     32179:     find library=libevent-1.4.so.2 [0]; searching
     32179:      search cache=/etc/ld.so.cache
     32179:      search path=/lib/tls/i686/sse2:/lib/tls/i686:/lib/tls/sse2:/lib/tls:/lib/i686/sse2:/lib/i686:/lib/sse2:/lib:/usr/lib/tls/i686/sse2:/usr/lib/tls/i686:/usr/lib/tls/sse2:/usr/lib/tls:/usr/lib/i686/sse2:/usr/lib/i686:/usr/lib/sse2:/usr/lib(system search path)
     32179:       trying file=/lib/tls/i686/sse2/libevent-1.4.so.2
     32179:       trying file=/lib/tls/i686/libevent-1.4.so.2
     32179:       trying file=/lib/tls/sse2/libevent-1.4.so.2
     32179:       trying file=/lib/tls/libevent-1.4.so.2
     32179:       trying file=/lib/i686/sse2/libevent-1.4.so.2
     32179:       trying file=/lib/i686/libevent-1.4.so.2
     32179:       trying file=/lib/sse2/libevent-1.4.so.2
     32179:  &


相关文档:

php对sql injection的防范

对http request过来的数据,凡是含有单引号,双引号,反斜线等都进行加斜线处理。防止进行注入操作。
/*
堵SQL漏洞
*/
function quotes($content){

//如果magic_quotes_gpc=Off,那么就开始处理
if (!get_magic_quotes_gpc()) {
//判断$content是否为数组
if (is_array($content)) {
//如果$content是 ......

PHP exif 介绍

 // PHP exif
// --
// wikipedia 介绍:
// EXIF(Exchangeable image file format)是可交换图像文件的缩写,是专门为数码相机的照片设定的,可以记录数码照片的属性信息和拍摄数据。
// EXIF可以附加于JPEG、TIFF、RIFF等文件之中,为其增加有关数码相机拍摄信息的内容和索引图或图像处理软件的版本信息。
......

php获取网站的内容(SSL,GET,POST形式都能获取到)!

封装一个function,以便复用。
支持https,或者http的get或者post。
function httpURLfeedback($url,$request_type,$time_out = "60") {
$arr = parse_url($url);
$transports = "";
$port = 0;
$host = $arr['host'];
$query = $arr['query'];
$path = $arr['path'];
if($urlarr["scheme"] ......

apache php 常见问题

 linux下apache+php安装常见问题 configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0 ......

php获取环境信息

系统版本比较
mixed version_compare ( string version1, string version2 [, string operator] )
version_compare('5.1','<');  //比较当前版本是否小于5.1
是否开启自动/
get_magic_quotes_gpc() 
return 1 on: will add slash.
return 0 off:willn't add.
if(get_magic_quotes_gpc()) {
 $cm ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号