Home Blog Wiki
Twitter Subscribe to PHP Blog RSS Feed Email RSS

三月, 2008的所有内容

编译内核方式升级FreeBSD

没有评论 三月 20th, 2008

1. 备份系统(FreeBSD6.3-release)
2. 使用FreeBSD6.2后系统自带的csup更新ports与src
#cp /usr/share/examples/cvsup/ports-supfile /root/ — update ports
#cp /usr/share/examples/cvsup/stable-supfile /root/ — update src
#vi /root/stable-supfile

时间函数问题-设置PHP5的时区

没有评论 三月 17th, 2008

<?php
$currtime=time();
$currtimestr=strftime ("%H:%M:%S ",$currtime);
echo "The time is : ".$currtimestr;
print (strftime("%A"));
?>

在PHP5中,不能和PHP4一样使用date() , time() 等时间函数正确地取得本地时间, 不同的代码在不同的OS里会产生不同的结果。解决办法,为PHP5设置统一的时区:
编辑 “php.ini”,找到以下行修改:
date.timezone = PRC   //PRC代表中华人民共和国

UTF-8 With BOM

没有评论 三月 17th, 2008

当我使用文本编辑器“Notepad++”时, 我发现一个“以UTF-8无BOM格式编码”的方式,如果Web页面的源文件以 UTF-8 格式编码的话,在校验 xhtml文件时会出来一条如下警告:
Byte-Order Mark found in UTF-8 File.
The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported.
意思是说使用utf-8的格式编码会在一些编辑器和老的浏览器上产生问题,最好是考虑避免这些问题,除非它们得到更好的支持。在这里我得到了更多的信息 http://unicode.org :

Configure Linksys AP

没有评论 三月 13th, 2008

Linksys Wireless-G Access Point: WAP54G
首先,我没有安装CD,不知道AP的IP地址是多少,所以我按Reset键重置了一下。

在路由器上添加多子网段 192.168.1.1,当然路由器没有这个功能的只能直接将路由局域网IP设置为此,然后在电脑中添加同网段的IP,如 192.168.1.10。最后在浏览器中访问此AP的默认地址:192.168.1.245.用户名为空,密码是 “admin”。
默认AP的模式( mode)是“ Access Point”。
点击“Wireless”,Mode(模式)为Mixed,修改Network Name(SSID),也就是搜索无线网络时显示的那个名称。Channel(频段),如果是使用单个AP的话可以不用修改,如果使用多个每个AP使用不同的频段比较好。
点选  Security,“Security Mode”我选择WPA-Personal,“Encryption”选择TKIP,然后填入Passphrase(密钥),客户端连接到此AP时需要填入此密钥方可接入网络。
Save settings(保存设置),就好了。

PHP 扩展:mbstring

没有评论 三月 6th, 2008

因为最小化安装的PHP,很多扩展没有启用,在登陆phpMyAdmin时得到一个警告:
The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
我发现 http://www.php.net/mbstring 上有介绍说:
mbstring provides multibyte specific string functions that help you deal with multibyte encodings in PHP.
Note: If you are connecting to [...]

Windows XP本地PHP开发环境

没有评论 三月 4th, 2008

注:除了phpMyAdmin,以下均为二进制的安装文件。
安装 apache_2.2.6-win32-x86-openssl-0.98e

Server information: 填入域名,服务器名,管理员信箱。
默认:for All users,on Port 80,as a service,即可。

选择Custem定制安装。为方便起见,更改安装目录到 “C:\Apache2.2\”。(理由是:某些配置文件对含空格的目录名比较敏感,这样能减少出错。)

Page 1 of 11