$_POST
似乎不起作用。我已经安装了 PhpStorm 10.0.3,并使用 WAMP 服务器默认的 php 解释器。
在 index.php 中:
<form method='post' action='a.php'>
<input type='text' name='user_f'>
<input type='submit' name='send' value='Send'>
</form>
在a.php文件中:
var_dump($GLOBALS);
当我在表单中输入"asdf"时:
array (size=9)
'HTTP_RAW_POST_DATA' => string 'user_f=asdf&send=Send' (length=22)
'_GET' =>
array (size=0)
empty
'_POST' =>
array (size=0)
empty
'_COOKIE' =>
array (size=0)
empty
'_FILES' =>
array (size=0)
empty
'_ENV' =>
array (size=0)
empty
'_REQUEST' =>
array (size=0)
$_GET
可以正常使用,但似乎解释器不会填充 $_POST
变量。
php 版本:5.4.12 (使用来自 http://php.net/downloads.php 的 5.6.18 和 7 解释器也存在同样的问题)
此版本的 php.ini 文件:(来自 WAMP 的默认设置)
其他端口(如 MySQL 的 3306 端口)在 PhpStorm 中可以正常工作。(与 phpmyadmin 的连接正常)
Xdebug 端口:9000 PhpStorm 内置服务器端口:63342
如果我从 Netbeans IDE 中使用默认的 localhost:8000 构建,则一切正常。
在我的笔记本电脑上也存在同样的问题。