現象
設定を色々いじっていたら、WordPressのログインフォームに何を入力してログインしてもまたログインページに戻されるだけで、ログインすることができなくなった。
試しに以下のtest.phpをサーバに設置してcurlでリクエストを送ってみたところ、以下のログのように$_POSTに何も入っていないことがわかった。
test.php
<?php
print_r($_POST);
curlのログ
$ curl -v -F a=b http://192.168.0.12:8080/test.php
* Trying 192.168.0.12...
* TCP_NODELAY set
* Connected to 192.168.0.12 (192.168.0.12) port 8080 (#0)
> POST /test.php HTTP/1.1
> Host: 192.168.0.12:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 137
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------8fead5c0cbafb9b2
>
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Mon, 25 Sep 2017 14:19:12 GMT
< Server: Apache/2.4.10 (Debian)
< X-Powered-By: PHP/7.1.9
< Content-Length: 10
< Content-Type: text/html; charset=UTF-8
<
Array
(
)
* Connection #0 to host 192.168.0.12 left intact
原因
今回の場合、php.iniでpost_max_size=20M
と書くべきところにpost_max_size=20MB
とBを付けていたことが原因でした。以上です。