phpBB3 資料夾與檔案讀寫屬性設定

Post Reply
Brave Ye
系統管理員
Posts: 5656
Joined: 2025-11-08, 13:32
Location: Taiwan
Contact:

phpBB3 資料夾與檔案讀寫屬性設定

Post by Brave Ye »

💡 安全提示(關於 777 權限):在如 Linux (Debian/Ubuntu) 系統中,如果您的檔案擁有者(Ownership)已經正確設定為 www-data,那麼資料夾給予 755 即可順利寫入。只有在虛擬主機(FTP 帳號與 Web 服務帳號不同)或權限無法完全釐清時,才逼不得已使用 777。

# 1. 先將所有資料夾一律設定為 755
find . -type d -exec chmod 755 {} \;

# 2. 再將所有檔案一律設定為 644
find . -type f -exec chmod 644 {} \;

# 3. 針對需要寫入的特殊資料夾,開啟寫入權限
chmod 777 cache/ files/ store/ images/avatars/upload/

# 4. 確保安裝完成後的設定檔是安全的
chmod 644 config.php

另外,也請確保整個討論區的檔案擁有者屬於執行 Apache/Nginx 的用戶
sudo chown -R www-data:www-data /path/to/your/phpBB3/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest