看板FreeBSD
标 题Re: 能否请 帮我看看 Guestbook 的 php code
发信站Shaw Residential Internet (Mon Jan 9 12:57:59 2006)
转信站ptt!ctu-reader!Spring!news.nctu!news.alt.net!pd7cy2so!shaw.ca!pd7tw1no
感谢 前辈不弃, 不吝指导.
其实我也很希望能自己找出毛病解决掉;
然就是鲁钝得很...
若有机会, 请不吝续指导...
> 先检查 apache 的 access log 跟 error log
> 看有没有什麽异样 确定那支程式有没有跑
1.
因为 httpd-access.log 曾有这个:
> : 192.168.x.x - - [07/Jan/2006:21:40:03 -0800] "POST /GB/index.php
> HTTP/1.1"
> : 200 57419 http://mydomain.myhost" compatible; MSIE 6.0; Windows NT 5.1;
> SV1;
> : MathPlayer 2.0; .NET CLR 1.1.4322)"
而 httpd-error.log 也曾有过这个:
[Fri Jan 06 11:22:20 2006] [error] [client 192.168.x.x File does not exist:
/usr/local/www/error/200
故,先在 httpd.conf 内加一行 200 的 error code :
ErrorDocument 200 "error code 200"
这样,大概不会有 httpd-error.log 说找不到 error code 200 的档了.
但, error code 200 意思应是: "OK 200 : The request was fulfilled."
2.
作个 即时监看 httpd-access log 及 httped-error log 的 两个 scripts: 1)
httplogconsole 及 2) httperrorconsole
# cat /root/script/httplogconsole
clear
rm /root/script/HTTPLOG
tail -0f /var/log/httpd-access.log | tee /root/script/HTTPLOG
# cat /root/script/httperrorconsole
clear
rm /root/script/HTTPERRORLOG
tail -0f /var/log/httpd-error.log | tee /root/script/HTTPERRORLOG
3.
跑了那两个 script , 然後跑一下 guestbook
( 我那 guestbook 在
http://neuro.ohbi.net/GB/ :)
并对照真正的 httpd 的 两个 log:
/var/log/httpd-error.log 果然没有新的 error log.
/var/log/httpd-access.log 说:
192.168.x.x - - [08/Jan/2006:20:45:36 -0800] "POST /GB/index.php HTTP/1.1"
200 57419 "
http://neuro.ohbi.net" "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; MathPlayer 2.0; .NET CLR 1.1.4322)"
故:
* 1 检查 apache 的 access log 跟 error log => 没有什麽异样
* 2 => 确定那支程式有跑
> 再加几行程式码到你的留言版
> 把它收到的东西印出来看对不对
> 自己试着学 debug 吧...
这... 我还要慢慢试着学...
或, 我把 php code 寄给 前辈,或者 po 出来,请帮我看看好吗?
谢谢
<: 老音学生 :>
===
"上班==上网??" <
[email protected]> 撰写於邮件新闻:
[email protected]...
>【 在 goaway. 的大作中提到: 】
> : 感谢感谢 前辈不吝发言 :)
> : 是.
> : 这是 POST 後, httpd 的 log 部份 :
> : 192.168.x.x - - [07/Jan/2006:21:40:03 -0800] "POST /GB/index.php
> HTTP/1.1"
> : 200 57419 http://mydomain.myhost" compatible; MSIE 6.0; Windows NT 5.1;
> SV1;
> : MathPlayer 2.0; .NET CLR 1.1.4322)"
> : 填了後, Guestbook 就当没事一样:
> : http_log , php_log , 及 该网页上, 都没有 error message;
> : 也没真的新增一笔到 xxx.dat.php 档, 也没寄给 root 通知单 (之前有设,是会
> : e-mail 一份通知的).
> : 请问我还须要显示啥?
> : 须要全档 guestbook php code 吗 ?
> : ( 只要 前辈说一声,当然没问题可以显示喔 :)
> : 谢谢谢谢~
> : <: 老音学生 :>
> : ===
>
> 先检查 apache 的 access log 跟 error log
> 看有没有什麽异样 确定那支程式有没有跑
> 再加几行程式码到你的留言版
> 把它收到的东西印出来看对不对
> 自己试着学 debug 吧...