.user.ini points auto_prepend_file to a missing file: HTTP 500 after a move
站主看到什麼
After the site was moved to another host, every page including the login page returned HTTP 500. The host error log showed "PHP Fatal error: Failed opening required '.../wordfence-waf.php'". A plain file (/license.txt) still returned 200.
出處(公開論壇帖): https://wordpress.org/support/?p=17075291
測試環境與弄壞後看到什麼
測試站:WordPress 7.1、PHP 8.3。下表是照配方弄壞之後,首頁與登入頁回的 HTTP 狀態。
| 主機環境 | 首頁 | 登入頁 | 備註 |
|---|---|---|---|
| Apache + PHP-FPM | 500 | — | /license.txt returned 200. The login page status was not recorded in these runs. |
每一跑的結局
| 日期(UTC) | 主機環境 | 連線模式 | 結局 | 維修站版本 | 備註 |
|---|---|---|---|---|---|
| 2026-11-06 | Apache + PHP-FPM | SSH | Not recovered | 2.1.434 | The re-check did not pass, and the system issued the automatic recovery-fee refund (payment is simulated in the lab). |
| 2026-11-06 | Apache + PHP-FPM | SSH | Declined at the pre-payment check | 2.1.434 | The pre-payment check timed out. |
| 2026-11-06 | Apache + PHP-FPM | SSH | Recovered | 2.1.435 | |
| 2026-11-06 | Apache + PHP-FPM | FTP | Case did not complete | 2.1.434 | Copying the site over FTP stalled and the case did not reach the health check. |
| 2026-11-06 | Apache + PHP-FPM | FTP | Declined at the pre-payment check | 2.1.434 | The pre-payment check timed out. |
| 2026-11-06 | Apache + PHP-FPM | FTP | Recovered | 2.1.435 | The FTP server offered explicit TLS and the product used it. |
缺口與修在哪一版
結局不是修好的跑次,都在這裡:改了什麼、修在哪一版、重跑的日期與結局。
| 發現日 | 主機環境 | 連線模式 | 改了什麼 | 修在哪一版 | 重跑 |
|---|---|---|---|---|---|
| 2026-11-06 | Apache + PHP-FPM | SSH | The recovery removed the broken setting on the copy, but the copy's PHP kept the old setting cached and the re-check failed. The copy now reloads PHP after the change. | 2.1.435 | 2026-11-06 · Recovered |
| 2026-11-06 | Apache + PHP-FPM | SSH | The pre-payment check timed out on this setup; it no longer does. | 2.1.435 | 2026-11-06 · Recovered |
| 2026-11-06 | Apache + PHP-FPM | FTP | Copying the site over FTP stalled and the case did not reach the health check. The copy step no longer stalls on this setup. | 2.1.435 | 2026-11-06 · Recovered |
| 2026-11-06 | Apache + PHP-FPM | FTP | Over plain FTP, passive-mode replies were dropped between the recovery station and the test server, and the pre-payment check timed out. The product now uses explicit TLS when the server offers it. The re-test was run after the test server was set to offer TLS; plain FTP on this path has not been re | 處理中 | — |
對到的故障項目
補充
On this setup PHP-FPM re-reads .user.ini on a cache interval, so a change to that file takes effect after a delay rather than on the next request.
這些是我們測試主機上、某一版、某一天的紀錄,不是對任何網站結果的承諾;其他主機、PHP 與 WordPress 版本的結果可能不同。