作者marphling (就是你)
看板PHP
标题[请益] 关於伺服器设定
时间Wed Apr 4 17:44:26 2007
我目前用阿帕契
但是在创造档案的时候 会一直创造不出来
请问一下 是阿帕契里面有哪些需要设定的吗?
下面是PHP程式码
<?php
$counterFile = "/tmp/counter.txt";
function displayCounter($counterFile) {
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "您是第 "."$num"." 位无聊份子";
exec( "rm -rf $counterFile");
exec( "echo $num > $counterFile");
}
if (!file_exists($counterFile)) {
exec( "echo 0 > $counterFile");
}
displayCounter($counterFile);
?>
跑出来的网页如下
Warning: fopen(/tmp/counter.txt) [function.fopen]:
failed to open stream: No such file or directory
in C:\AppServ\www\lovewen\test.php on line 19
Warning: fgets(): supplied argument is not a valid stream resource
in C:\AppServ\www\lovewen\test.php on line 20
您是第 1 位无聊份子
请帮忙解答谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.91.104.150
1F:推 allanshen:没有 /tmp 这个目录 04/04 17:49
2F:推 marphling:请问 /tmp 是在网页所处的资料夹吗? 04/04 17:57
3F:→ marphling:已解决 感恩 04/04 18:03