Rick
Rick

Reputation: 19

PHP Debug in VSCode

I am trying to get PHP debugging to work in VS code on a Debian system. I have followed several different posts and videos and help files and just can't get it to work. There is conflicting information probably due to different versions of the software?

Here is what I have:

Installed VS Code extensions PHP Debug PHP Intellisense

Installed xdebug through apt-install (shows version 3.02+2.9.8....) But if I run phpinfo() I do not see an entry for xdebug Running the xdebug wizard it says that xdebug is not installed so I followed the steps outlined

   download/extract xdebug-3.1.3
   run phpize
   run ./configure
   run cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20200930
   ^^This gives me an error cp: cannot stat 'modules/xdebug.so' : no such file or directory

The instructions also state to add

   zend_extension = xdebug

In the VS Code, it stated to make the follwing changes: added below to /opt/lampp/etc/php.ini (php.ini as shown by phpinfo()) (in the Dynamic Extensions section) zend_extension =xdebug.so (I tried keeping the above one and keeping just this one)

(at the end of the file-not sure where it was supposed to go? But looks like it is in the [opcache] section?

xdebug.mode= debug
xdebug.start_with_request = yes

And I tried several other things and still no luck. What info do you need and what do I need to do to get the debugging working?

Thanks

Upvotes: 0

Views: 416

Answers (1)

Derick
Derick

Reputation: 36774

download/extract xdebug-3.1.3
run phpize
run ./configure
run cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20200930

The wizard instructions tell you to run make between run ./configure and run cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20200930

The make step is what compiles the extension.

Upvotes: 1

Related Questions