Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger xDebug in PhpStorm when calling using CURL

so I use CURL from the command line to make calls to my PHP website:

curl -s "url" 

My question is...is it possible to modify this command so that I can trigger xDebug (combined with an IDE (I use Jetbrains PHPStorm)) when calling the site from CURL

perhaps manipulate the GET variables?

like image 916
pillarOfLight Avatar asked Sep 24 '13 15:09

pillarOfLight


People also ask

How do I enable Xdebug log?

Enable Xdebug logging by adding the following line into php. ini: xdebug. remote_log=/log_path/xdebug.


2 Answers

The following code works for me

curl -i -X POST -d '{"some":"data"}' http://your-local-domain -b XDEBUG_SESSION=PHPSTORM 
like image 91
wyxa Avatar answered Sep 17 '22 14:09

wyxa


I was still having trouble until I added path=/ to the cookie in addition to wyxa's answer.

curl --cookie "XDEBUG_SESSION=PHPSTORM;path=/;" localhost 
like image 24
Tin Can Avatar answered Sep 17 '22 14:09

Tin Can