跳至內容
工具

wp-config.php Generator

Build a correct wp-config.php without copy-pasting from a 2014 blog post

在你的瀏覽器裡執行。什麼都不會被上傳。

Database
Debugging
Hardening
Limits
wp-config.php

Salts are generated in your browser with crypto.getRandomValues(). They are never sent anywhere — but for the record, WordPress's own api.wordpress.org salt endpoint is equally fine; it returns fresh random values over TLS.

關於wp-config.php Generator

Generate a wp-config.php with the constants you actually need — debug logging, memory limits, file-edit lockdown, upload limits, table prefix, and fresh salts. Everything is generated in your browser; nothing is sent anywhere.

FAQ

常見問題

在瀏覽器裡產生 wp-config.php 的 salts 安全嗎?

安全。這些 salts 是用 crypto.getRandomValues() 產生的,也就是瀏覽器內建、符合密碼學安全標準的亂數產生器,而且永遠不會離開你的機器。順帶一提,WordPress 官方的 api.wordpress.org salt 端點同樣安全——它會透過 TLS 回傳全新的亂數值。這是為了方便,不是什麼資安修補。

為什麼它不會問我的資料庫密碼?

因為無論一個網頁號稱多可信,你都不該把正式環境的資料庫密碼打進去。產生出來的檔案裡有一個預留位置——請在本機、在你的編輯器裡填進去。

我可以在既有的網站上更改資料表前綴嗎?

光靠編輯 wp-config.php 沒辦法。在運作中的網站上更改 $table_prefix,需要重新命名每一張資料表,並改寫 options 與 usermeta 資料表裡的兩列資料。要嘛在全新安裝時更改,要嘛就別動它。