Debug PHP With Xdebug in Netbeans and via FTP - php

I have a PHP application that runs on a Debian server where I've installed apache 2.2.4 and xdebug.
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.0.2
xdebug.remote_port=9000
All the PHP files are saved on this server. The Server IP is : 192.168.0.2
The problem is that I'm opening the PHP project via FTP with Netbeans on a Windows 7 environment where apache is NOT installed!
Is it possible to debug in this scenario and does someone have any links for direction how to configure this scenario?
Please any help would be appreciated.
Thanks in Advance

Now i found a solution.
These links helped me:
http://wiki.netbeans.org/HowToConfigureXDebug
http://www.google.de/?gws_rd=ssl#q=php+netbeans+xdebug+configuration
The xdebug.ini i modified like this:
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.idekey=netbeans-xdebug
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.0.103
xdebug.remote_port=9001
The IP adress 103 is the adress of my local machine and i had to add the idekey to the ini.

Related

PHP: Xdebug access denied exit with code 0

I have set the PHP project on Mac with XAMPP and installed Xdebug there, but on my PhpStorm I get:
I did not manage to find anything on the web.
My php.ini
[xdebug]
;zend_extension=xdebug.so
zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9002
xdebug.remote_log="/mnt/log/xdebug.log"
xdebug.remote_autostart=1
xdebug.idekey=phpstorm
xdebug.remote_mode = req
I might be coming late to the party, but make sure XDebug has Write access to the folder, let alone if you're using Docker.
If it's local, then just out of investigation try:
chmod 777 /mnt/log/xdebug.log
However, I'd rather choose to state a folder for the logging over a file.
If it's running within Docker, then "chmod" the actual mounted folder instead.

PhpStorm 2016.2.2 xdebug configured in php and in PhpStorm but breakpoints don't stop

I configured Xdebug in php.ini and I see it in phpinfo().
And I see the Xdebug version in Interpreter I have XAMPP v3.2.2 in Windows 10.
I attach some pictures to explain what I have.
Please help me how can I make PhpStorm stop at breakpoints?
My php.ini
[XDebug]
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=1
xdebug.profiler_enable=1
;xdebug.remote_connect_back=1
Interpreters
Languages & Frameworks>PHP>Debug
Try to change xdebug.remote_host="localhost:8081" to xdebug.remote_host=localhost. You already specified the port in xdebug.remote_port, so the host setting must contain only host name.
Also check that port 9000 is really held by PHPStorm. There can be a conflict with PHP FPM, because it uses the same port by default.

Xdebug installed on Mac Native apache

I am trying to get XDEBUG up and going but having trouble getting the cookie to show. Below is what is put in my php.ini file. I restarted apache. I did a phpinfo() call and I do see xdebug enabled and the settings set. But when I do a localhost/?XDEBUG_SESSION_START=1 I am expecting to see a Cookie set to 1 in my browser right ?
zend_extension ="/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=1
xdebug.profiler_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_output_dir="/tmp"
when I run php -m I do not see it but I do see it in phpinfo
couldnt figure the exact answer but I went and downloaded the php.ini.default file from repo and set the following in the php ini
zend_extension ="/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.idekey=foo
xdebug.profiler_enable=On
and it worked. could of been because of remote host. who knows. it worked. this is the bare minimum configurations for mac and this is if your going by the follwing installations for xdebug on mac
http://kubyshkin.ru/posts/installing-php-xdebug-extension-on-mac-os-x-10-7-lion.html

net beans xdebug waiting for connection error?

i have done almost every thing to resolve this issue. . .but message waiting for connection is still there. . . . . is there any way to debug this issue. i am using xampp server. OS windows
[XDebug]
zend_extension = "C:\Users\arslan\Desktop\xampp-win32-1.8.1-VC9\xampp\php\ext\php_xdebug-2.2.3-5.4- vc9.dll"
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9001
i tried on ecllipse too with both zend and xdebug. connection problem continue to exists.
i have already gone through stackoverflow and netbean forums.
i have alredy wasted my full day to figure out the solution but fialed.
The Library file really exists?
Change the port 9001 to 9000, restart apache and try again.
it worked.
Actually i was not restarting apache after changing php.ini.
working php.ini
[XDebug]
zend_extension= "C:\Users\arslan\Desktop\xampp-win32-1.8.1-VC9\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host="localhost"
xdebug.remote_port=9001
xdebug.remote_autostart=1
OS windows
Xampp
php 5.4
NetBeans 7.3.1

Setting up Xdebug for drupal site

I have been trying to get xdebug, netbeabs 7.0 and drupal work to no avail. The drupal site is hosted remotely on xyz.com:8081. The port forwarding is setup to forward the port 9000 to the host in that network. xdebug is installed and correctly shows up in phpinfo() but my netbeans says "waiting for connection (netbeans-xdebug)". Below is what I have in my php.ini
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_connect_back=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
also I read some where that I have to have the same in my /etc/php5/cli/conf.d/xdebug.ini and I tried that too.I tried change the localhost to xyz.com and it didn't work.
I also need to know what should be the project configuration in netbeans. for instance xyz:8081/drupal?
Thank you all,
Xdebug needs to connect back to your workstation on the port specified. Try something like this. The key is that the server will connect back to your workstation, so if you're behind a nat'd firewall then you need to port forward 9000 to your workstation running netbeans.
xdebug.remote_enable=1
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.idekey=NETBEANS_DBGP
xdebug.remote_handler=dbgp
xdebug.remote_host=IP_OF_YOUR_WORKSTATON
Some of these settings are described in more detail here: http://www.flingbits.com/tutorial/view/xdebug-for-developing-debugging-and-profiling-php
There's also netbeans specific setup info here: http://wiki.netbeans.org/HowToConfigureXDebug

Categories