debugging php with XDEBUG

General questions regarding the usage of CodeLite
Stephan123
CodeLite Curious
Posts: 3
Joined: Mon Apr 20, 2020 2:37 pm
Genuine User: Yes
IDE Question: Php
Contact:

debugging php with XDEBUG

Post by Stephan123 »

Hello,

i will debugging a simple script.

I works under Windows 10.
I start the the build in php server with:

-----------
php -S 127.0.0.1:80 -t c:/xampp1/htdocs/test/public/
-----------------------

In the php.ini file i have the block:

---------------------------
[Xdebug]
zend_extension = C:\xampp1\php-7.3.6\ext\php_xdebug.dll

; remote Debugging
xdebug.remote_enable = true
; xdebug.remote_autostart = true
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.idekey="PHPSTORM"

-----------------------

When i run the command;

-----------------
phpinfo();
--------------------

I see in the browser xdebug work correct.

My test script is:

-------------------
<?php

$test123;

for($i = 0; $i < 10; $i++){
echo $i."<br>";
}

----------------------------

when i call 127.0.0.1/public/index.php
the script works correct.

Now my question. How can i start xdebug in CodeLite ?


Your sincerly

Stephan
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debugging php with XDEBUG

Post by eranif »

I just tested with PHP 74. And it works (Windows 10/64)
I created a tutorial and updated the wiki:

https://wiki.codelite.org/pmwiki.php/Ma ... WithXDebug


HTH,
Eran
Make sure you have read the HOW TO POST thread
kur-ka
CodeLite Curious
Posts: 5
Joined: Sun Jul 19, 2020 7:58 pm
Genuine User: Yes
IDE Question: jsc
Contact:

Re: debugging php with XDEBUG

Post by kur-ka »

Extending almost the same question:
What do I need to install on a Win10 machine to be able to use Codelite for Javascript and PHP programming?
- any stand alone browser (not to mention the cranky stock Edge)
- any stand alone server with PHP enabled (toghether with Xdebug)?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: debugging php with XDEBUG

Post by eranif »

in order to debug PHP code, you will need:
WebServer (Apache 2.4 or something similar)
Xdebug extension *loaded*
Any browser will do (I personally am using firefox, but chrome will do as well)
Make sure you have read the HOW TO POST thread
Post Reply