2012-05-21 36 views
1

我正在使用Netbeans來調試PHP。我沒有獲得php.ini所以我用.htaccessxdebug - 在netbeans中等待連接

php_value xdebug.remote_host "localhost"  
php_value xdebug.idekey    "netbeans-xdebug" 
php_flag xdebug.remote_autostart  Off 
php_flag xdebug.remote_enable   On 
php_value xdebug.remote_port   9000 
php_value xdebug.remote_handler   dbgp 
php_flag xdebug.profiler_enable  on 
php_flag xdebug.remote_connect_back On 
php_flag xdebug.extended_info   On 

sub.mydomain.com運行與端口8080和8090我以前使用的Eclipse Xdebug的這臺服務器上。

與上述設置安裝在一起的sub.mydomain.com服務器的phpinfo()列表的XDebug:

Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies 
with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans 

在NetBeans我已經配置了‘屬性’和‘運行配置’條目和端口和ID匹配也(9000 ,netbeans-xdebug)。

sub.mydomain.com上有很多開發人員,如果有人使用端口9000,這可能是一個問題嗎?

如果我在Netbeans中運行「調試」,永遠會出現「等待連接」。

我該怎麼辦?

編輯:固定爲localhost

回答

1

證明我已成功地開始了下面的配置調試器:

php_value xdebug.remote_host "192.168.1.149" 
php_value error_reporting    22527 
php_flag xdebug.remote_autostart  Off 
php_flag xdebug.remote_enable   On 
php_value xdebug.remote_port   9009 
php_value xdebug.remote_handler   dbgp 
php_value xdebug.remote_log    "..." 
php_flag xdebug.profiler_enable  off 
php_flag xdebug.extended_info   On 
php_flag xdebug.coverage_enable  On 
php_value error_log      "..." 
0

這是錯誤的:

php_value xdebug.remote_host "sub.mydomain.com" 

的xdebug.remote_host設置需要包含有你IDE它的機器的IP。這當然也意味着運行PHP/Xdebug的機器需要能夠連接到該IP地址。這也是在http://xdebug.org/docs/remote#communication

+0

感謝您的回答。我編輯了'remote_host'到我的IP 192.168.1.149的IDE,但它仍然不起作用。 – Patrick

+0

遠程調試日誌中顯示了什麼(請參閱http://xdebug.org/docs/all_settings#remote_log關於如何創建一個) – Derick

+0

感謝您的msg。該文件一直是空的。路徑是正確的,並且chmod 777.我還能檢查什麼來找到原因? – Patrick