简体   繁体   English

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

[英]Cannot connect to xdebug (running on xampp for mac) via php script

I try to run the following PHP script and nothing happens: 我尝试运行以下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);

It appears to just hang. 它似乎只是挂起。

I have figured it out. 我已经知道了。 I added the following to my php.ini: 我在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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM