netbeans的debug功能

python的pycharm有很方便的debug,我在思考平时写php用的netbeans能不能,于是我试着点了一下断点,在冒泡排序的中间,发现不行,显示netbeans显示“等待连接(netbeans-xdebug)

function BubbleSort(array $container)
{
    $count = count($container);
    for ($j = 1; $j < $count; $j++) {
        for ($i = 0; $i < $count - $j; $i++) {
            if ($container[$i] > $container[$i + 1]) {
                $temp = $container[$i];
                $container[$i] = $container[$i + 1];
                $container[$i + 1] = $temp;
            }
        }
    }
    return $container;
}
BubbleSort([4, 21, 41, 2, 53, 1, 213, 31, 21, 423]);

于是我在php.ini里面搜索xdebug,加入

[XDebug]
xdebug.profiler_output_dir="E:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir="E:\phpStudy\tmp\xdebug"
zend_extension="E:\phpStudy\php\php-5.4.45\ext\php_xdebug.dll"
xdebug.remote_port=9001
xdebug.idekey=netbeans-xdebug
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
extension="./ext/php_igbinary.dll"
extension="./ext/php_redis.dll"

然后在neabeans里面的工具->选项PHP

再次debug,应该可以了

All posts

Other pages

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注