教學來源: http://www.phpbb.com/phpBB/viewtopic.ph ... rh8#318226
作者: Jan Houtsma
翻譯: slei (應小竹子的要求)
這是一個新的方法使phpBB可以在 Redhat 8.0 (Apache2 + PHP4)運行. 它使 phpBB中的 .php 檔案有了一個新的timestamp. 這個修改可以使 IE6 直接去讀檔案而不是cache. 但是你要付出的代價是相對較長的讀取時間.
首先, 你要打開並修改 PHP 的configuration檔案.
#
#-----[ 打開 ]------------------------------------------
#
/你的PHP路徑/php.ini
#
#-----[ 尋找 ]------------------------------------------
#
代碼: 選擇全部
register_globals = Off
#-----[ 替換成 ]------------------------------------------
#
代碼: 選擇全部
register_globals = On
然後利用下列命令去重新啟動你的Apache2 webserver:
代碼: 選擇全部
/etc/init.d/httpd restart
#
#-----[ 複製/上傳 phptouch1 到你的phpBB路徑並且修改 <myforum> 成為你的phpBB的路徑 ]-----
#
代碼: 選擇全部
#!/bin/sh
if [ -f /tmp/phptouch ]
then
exit 0
else
/var/www/html/phpBB2/phptouch2 >/dev/null &
fi
#-----[ 複製/上傳 phptouch2 到你的phpBB路徑並且修改 <myforum> 成為你的phpBB的路徑 ]-----
#
代碼: 選擇全部
#!/bin/sh
myforum=/var/www/html/phpBB2
myfiles="\
$myforum/common.php \
$myforum/groupcp.php \
$myforum/memberlist.php \
$myforum/privmsg.php \
$myforum/search.php \
$myforum/viewtopic.php \
$myforum/index.php \
$myforum/modcp.php \
$myforum/profile.php \
$myforum/viewforum.php \
$myforum/login.php \
$myforum/posting.php \
$myforum/viewonline.php"
touch /tmp/phptouch
sleep 1
touch $myfiles
rm -f /tmp/phptouch
#-----[ 執行 ]------------------------------------------
#
代碼: 選擇全部
cd <你的phpBB路徑>
chown apache.apache phptouch1 phptouch2
chmod 700 phptouch1 phptouch2
#-----[ 打開 ]------------------------------------------
#
你的phpBB路徑/includes/template.php
#
#-----[ 尋找 ]------------------------------------------
#
代碼: 選擇全部
// Run the compiled code.
eval($this->compiled_code[$handle]);
return true;
#-----[ 在之前加上 ]------------------------------------------
#
代碼: 選擇全部
// 修改為你自己的 <phpBB路徑>
system('/var/www/html/phpBB2/phptouch1');
#-----[ 打開 ]------------------------------------------
#
你的phpBB路徑/includes/page_header.php
#
#-----[ 尋找 ]------------------------------------------
#
代碼: 選擇全部
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
#-----[ 替換成 ]------------------------------------------
#
代碼: 選擇全部
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
#-----[ 儲存/關閉 全部檔案 ]------------------------------------------
#
# 完成