开发者

php debugging with netbeans in ubuntu

I cant make netbeans 6.9 work with xdebug. Strangely I tried telnet

nerkn@nerkn-laptop:~/www/nerkl$ telnet localhost 9000
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to c开发者_高级运维onnect to remote host: Connection refused
nerkn@nerkn-laptop:~/www/nerkl$ telnet bogaz  9000
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

also I cant find debugclient.

xdebug is working: I got logging and pretty error reporting.

What can I do? I just want a basic step by step trace.


xdebug is working: I got logging and pretty error reporting.

You need to enable remote debugging.

Try this in xdebug.ini:

[xdebug]
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9000


The solution that worked for me; solved the debugging issue of netbeans it did not solved telnet "Connection refused" issue.

My solution:

In php.ini file (i.e. located in /etc/php/7.2/apache2/php.ini); comment the option in [xdebug] section (usually the last section at the end of the file)

;xdebug.remote_autostart=on

then restart the apache service

sudo systemctl restart apache2.service

try restarting the netbeans if this option was enabled and you disabled it.

@troelskn it not the xdebug.ini file; it is php.ini file.



Caution: If for now Xdebug only work with php 7.2. (Please only use uptil Xdebug 2.6, because later versions had some issues with debugging). So if you had any other version installed like php 7.3 or 7.4 then oyu had to also install php 7.2 along side your current php version (mostly because now by default latest version is installed through apt). and then update in between alternatives.



To set PHP 7.0 as the default, run

update-alternatives --set php /usr/bin/php7.0

To set PHP 7.2 as the default, run

update-alternatives --set php /usr/bin/php7.2

To set PHP 7.3 as the default, run

update-alternatives --set php /usr/bin/php7.3

To set PHP 7.4 as the default, run

update-alternatives --set php /usr/bin/php7.4

Before we can configure Apache to use PHP 7.2, we need to disable the new (or old) version of PHP by typing

a2dismod php7.4

Now enable the newly installed PHP 7.2 version with the following command:

a2enmod php7.2

Restart the Apache web server for the changes to take effect:

sudo systemctl restart apache2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜