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

apache and php common tips and problems

When I deploy php application on apache, some problem come out, and solved. Here's the tips and problems solved.
0.How could I deploy an apache server armed with php, mysql, perl, and phpMyAdmin on the fly?
You need a package bundled with all these tools,  xampp shall meet you needs, you can download it here
(windows/mac/linux/Solaris supported):
http://sourceforge.net/projects/xampp/files/
1. I meet the php page error:
strftime() [function.strftime]: 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.
You can
explicitly set it in any of the following ways:
a.The date.timezone setting in php.ini
b.At runtime with date_default_timezone_set()
c. Setting the TZ variable in Apache's environment (in
httpd.conf, .htaccess, or a few other ways)
solve a: uncomment the date.timezone line, and set the timezone to your desired,
such as 'Europe/Berlin' or 'Asia/Shanghai'
   [Date]
   ; Defines the default timezone used by the date functions
   date.timezone = Asia/Shanghai
2. apache\logs\error.log shows "Bad file descriptor: don't know how to spawn child process" like :
[Mon Jan 25 16:59:59 2010] [error] [client 127.0.0.1] D:/XXXServer/trend/coretech/abc.html is not executable; ensure interpreted scripts have "#!" first line
[Mon Jan 25 16:59:59 2010] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: D:/XXXServer/trend/coretech/abc.html
[Mon Jan 25 18:17:49 2010] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: D:/mywebapp/img/left-content-header.css, referer: http://127.0.0.1/mywebapp/navigation.php
solution: some version of Apache/2.2.14 (Win32) doesn't process read only files properly, 
you can solve


相关文档:

利用php写文件的功能仿花生壳更新ip的功能.

 1. 借用别人的域名作父域名.
2. 借用此空间建立一php文件,此php功能为,提供地址栏的某个参数时,检测此参数,正确,就获取当前的远程ip写入一js.
3. 其它人访问此php,直接访问,并没有提供参数,所以,直接载入上面的js,即直接转向到远程ip,这样就达到 更新/跳转功能了.同时可以利用js的img onerr事件检测远程ip是否正确, ......

PHP整合FCKeditor

声明,我用的PHP框架是CI(codeignitor)
首先下载FCKeditor 2.6.3 (我使用的是这个版本)
可以在CSDN中下载
解压,将FCKeditor2.6.3下面的fckeditor整个文件夹复制到网站根目录(和index.php)同一个目录,并更名为fck(不改名也行,但后面设置根路径的时候,记得改名字)
然后 ......

PHP $_GET


$_GET 变量用于收集来自 method="get" 的表单中的值。
$_GET 变量
$_GET 变量是一个数组,内容是由 HTTP GET 方法发送的变量名称和值。
$_GET 变量用于收集来自 method="get" 的表单中的值。从带有 GET 方法的表单发送的信息,对任何人都是可见的(会显示在浏览器的地址栏),并且对发送的信息量也有限制(最多 100 个 ......

PHP 执行系统外部命令 system() exec() passthru()


区别:
system() 输出并返回最后一行shell结果。
exec() 不输出结果,返回最后一行shell结果,所有结果可以保存到一个返回的数组里面。
passthru() 只调用命令,把命令的运行结果原样地直接输出到标准输出设备上。
相同点:都可以获得命令执行的状态码
////////////////////////////////////////////////////////// ......

php中计算时间差的几种方法

在php中计算时间差有时候是件麻烦的事!不过只要你掌握了日期时间函数的用法那这些也就变的简单了:  
一个简单的例子就是计算借书的天数,这需要php根据每天的日期进行计算,下面就来谈谈实现这种日期计算的几种方法:
(1) 如果有数据库就很容易了!若是MSSQL可以使用触发器!用专门计算日期差的函数datediff()便可 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号