无法通过php脚本连接到xdebug(在xampp上为mac运行)

时间:2014-10-24 17:58:12

标签: php macos xampp xdebug

我尝试运行以下PHP脚本,但没有任何反应:

$address = '127.0.0.1';
$port = 9000;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
socket_bind($sock, $address, $port) or die('Unable to bind');
socket_listen($sock);
$client = socket_accept($sock);
echo "connection established: $client";
socket_close($client);
socket_close($sock);

似乎只是挂起。

1 个答案:

答案 0 :(得分:0)

我已经弄清楚了。我在php.ini中添加了以下内容:

xdebug.remote_enable =1
xdebug.remote_hander =dbgp
xdebug.remote_mode = req
xdebug.remote_host =127.0.0.1
xdebug.remote_port = 9000
xdebug.idekey=netbeans-xdebug