-
Hello 🙂 I'm trying to remote debug my worker script with xdebug in PHPStorm. When I tell PHPStorm to break on first line, it does so, but since the $_SERVER["SERVER_NAME"] is an empty string, I cannot map directories to actually remote debug my application. Is there any way to set the "SERVER_NAME" on franken startup? I'm guessing that what triggers xdebug initially is the "dummy" request, which has a very limited set of headers. I thought of triggering xdebug on a legit request by setting FRANKENPHP_LOOP_MAX=1 to make the php script die soon and start again, but I'm getting sigsegv there right now. How do you guys go about this? Thank you 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
see: #492 |
Beta Was this translation helpful? Give feedback.
-
After having further discussions and digging deeper I discovered that there is actually a very simple solution to this. FrankenPHP passes ENV variables defined under given workers as $_SERVER variables into your php scripts. Once I had the "SERVER_NAME" variable set up, PHPStorm identified it and used the associated path mapping to let me debug my worker script just like I'm used to under "normal" circumstances. ENVs are passed like this 🔽
|
Beta Was this translation helpful? Give feedback.
After having further discussions and digging deeper I discovered that there is actually a very simple solution to this. FrankenPHP passes ENV variables defined under given workers as $_SERVER variables into your php scripts. Once I had the "SERVER_NAME" variable set up, PHPStorm identified it and used the associated path mapping to let me debug my worker script just like I'm used to under "normal" circumstances.
ENVs are passed like this 🔽