正在加载...
分页: 1/12 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]

因 php Hash碰撞

特此升级了 php  5.3.9 升级过程一切正常,安装加载 pdo_mysql 扩展 也没问题,全部完事后运行 phpinfo() 函数

This is The PHP Code
<?php
phpinfo();
?>
Parsed in 0.037 seconds at 517 B/s

结果发现没pdo_mysql没加载上,启动时候也没报错,日志也没任何错误信息。

放到 php 5.2.17 就没问题,于是怀疑版本兼容问题,就重新下载 PDO_MYSQL

结果还是一样,
Tags: , ,

升级最新 Nginx Mysql Php

[ 2011/10/04 19:48 | by selboo ]
本站博客使用的是 瑞豪开源(RASHOST) 美国 Linux VPS

web架构使用的是 Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)

上面文章已经一年多也没更新,本着开源精神,爱折腾,爱最新版,十一在家呆着没事。

对本博客升级到最新版本 nginx-1.0.8, mysql-5.5.16, php-5.3.8

一、Nginx升级

This is The Text Code
[root@74-82-173-217 lnmp]# wget http://www.nginx.org/download/nginx-1.0.8.tar.gz
[root@74-82-173-217 lnmp]# tar zxvf nginx-1.0.8.tar.gz
Parsed in 0.000 seconds at 525.63 KB/s
Tags: , , , ,
函数名称:ignore_user_abort
官方说明:http://cn2.php.net/manual/en/function.ignore-user-abort.php
使用方法:

即使Client断开(如关掉浏览器),PHP脚本也可以继续执行.
ignore_user_abort(true);


这样就可以实现计划任务效果了.但是还是要客户端访问程序才行.
比如说在生成静态页面、采集的时候,不需要在等待了。关掉浏览器吧。
例子:

set_time_limit(0);
ignore_user_abort(true);
$i = 0 ;
while($i ++ < 200){
    file_put_contents($i.'.php' , $i);
    sleep(3);
}

Tags: ,
From:http://www.zdyi.com/file-type-validation/624

      在PHP开发中,传统的上传文件类型验证是基于文件扩展名的验证方式(如pathinfo函数),很容易通过修改扩展名来欺骗。
我这里写了一个验证类,是通过文件头来判断文件格式.(也不是百分之百安全,如果用户伪造了文件头,也能通过验证)

[code]<?php
/**
* 检证文件类型类
*
* @author Silver
*/
class FileTypeValidation
{
  // 文件类型,不同的头信息
  private static $_fileFormats = Array(
    'jp2' => '0000000C6A502020',<
Tags: , ,
nl2br();// \n to

addslashes(); stripslashes();//对数据库操作时,转义特殊字符

chop();//除去字符串右边空格
trim();//除去字符串中所有空格
ltrim();//除去字符串左边空格

htmlspecialchars();//转换'$','"','<','>'为相应的html实体
htmlentities();//转换所有html标记为相应的html实体

array explode(string separator, string str);//分割字符串
string implode(string separator, array arr);//连接字符串

strtoupper(); strtolower();//转换大小写
ucfirst();//只转换第一个字符为大写
ucwords();//转换每个words的第一个字母为大写
123
Tags: ,
分页: 1/12 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]