PHP的时区问题
装了PHP-5.3.0, 启动的时候总是会有
"[06-Aug-2009 13:27:31] PHP Warning: PHP Startup: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in Unknown on line 0
在lib.ini中设置date.timezone = "Asia/Shanghai", 也没有什么用...
最后在shell中执行TZ='Asia/Shanghai'; export TZ , 重启php-fpm, 解决了..
相关文档:
PHP中设计模式的学习笔记
设计模式(Design Pattern)是面向对象设计中反复出现的问题的解决方案,设计模式是一种比一般类的设计更加抽象的一种思想,
它往往涉及到多个类的定义和使用。
在PHP的开发过程中,经常使用到得设计模式包括:简单工厂模式、单元素模式、观察者模式、命令模式、策略模式以及MVC模式等。
/ ......
<?php
//GB2312的Encode
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
/*重点了解strtotime()函数
1、strftime比time()好用,可以直接把常用的’2010-02-03‘转成时间戳。
2、date( ......
<?php
function make_rand($length="32"){//验证码文字生成函数
$str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$result="";
for($i=0;$i<$length;$i++){
$num[$i]=rand(0,61);
$result.=$str[$num[$i]];
}
return $result;
} ......
近来对php比较感兴趣,就断断续续的花了两个星期的时间把整个php开发需要用到的东西都装好了,大概的安装过程如下。
一、安装的软件:
Apache: 2.2.14
PHP:5.2.12
MySQL:5.1.42。
SVN:1.5.6
PHPMyAdmin:3.2.5
Zend Studio: 7.1
Zend Debugger: 5.1.14
二、安装过程:
1. 安装和配置apache
安装:首先从http://apa ......