Unable to debug PHP API from an Android Client - php

I am trying to debug my PHP API (XDebug + PHPStorm configurated and working correctly) calling it from an Android application.
I have enabled remote debug in PHPStorm and if I do a request from, for example, Postman, PHP Storm stops on the selected breakpoints.
However, when the Android app (in debug mode) do a request to php server (with PHPStorm opened), the Android app gets the response but it does not stop on breakpoints.
Why?
Thanks

You need your Android application to make requests with the XDebug cookie set. This, in case you've configured XDebug to allow debugging from different IP addresses other than the local Development Box.

Related

how to debug local php application running on WAMP server exposed publicly via ngrok using visual studio code?

I am trying to test my dialogflow fulfilment webhook(which needs to be publicly accessible) PHP endpoint. I am using WAMP server and visual studio code as IDE to run my PHP application on my local and made it publicly accessible using ngrok. Using localhost URL, I am able to debug the application using xdebug extension. But when I use the ngrok URL, I am able to access it perfectly but I am not able to debug it. I have tried to follow this link :
https://hajekj.net/2016/09/06/remotely-debugging-php-on-azure-web-apps-with-ngrok/ , but it is using TCP endpoint, whereas I need an https endpoint. How can I debug in this case?
When we use ngrok tunnelling, doesn't it finally route all the requests we receive to localhost? Because I am getting the desired results, but not able to debug.

Http request refused on Windows environment but not on OSX (mac)

I am working on a React web app with npm for the first time. I'm done with the development and now putting the built package on the web server (bluehost).
All is working well on my Mac: the web app allows getting data from mySQL via php, and posting back to the database.
But when I try the same app (on the same URL, same server, script, same everything...) on my Windows machine, I get an error on the first http request used for authentication.
OPTION http://example.com/script.php net::ERR_CONNECTION_REFUSED
First I thought this was a browser issue.
But I don't get the error on Chrome on my mac but do on Chrome on my Windows, as well as FireFox.
Again, I do not get this error when I test the app on my mac.
Could anybody please give me some direction to solve this?
Thank you!

How to Xdebug multiple sites hosted on my local machine that make requests to each other (in PhpStorm)?

I'm attempting to get Xdebug working with PhpStorm on multiple sites. Say I have 2 sites both being served in the same vagrant VM on my local machine:
http://my-app.dev (makes requests to the API below, xdebug is working)
http://my-rest-api.dev (receives requests, but xdebug is not working)
My App makes requests to my rest API. When I visit http://my-app.dev in my browser, Xdebug is working correctly in PhpStorm for that project. I'll also have the API project open in PhpStorm as well. When I set breakpoints in the API project they are never hit (even though my App is successfully making requests to this API). The only way I can get the breakpoints to work in the API is if I open a browser tab and type in the API's endpoints directly into the address bar. I know there are extensions I can use to test API endpoints, but this is not convenient at all, since the requests would be cumbersome to build manually each time.
Both projects are set in PhpStorm to listen to PHP debug connections. I also tried turning on xdebug.remote_autostart = 1 in my xdebug.ini file on the VM server. I've also set Max. simultaneous connections to 10 in PhpStorm Debug preferences.
Any solution on how I can debug both these sites together? I think this is a question that would help a lot of developers.

Attach Eclipse php debugger to Apache server

I have built an app that sends requests to a server.
I also built a server to response those requests. I have a PHP server locally (LAMP).
Now, for debug purposes , I want to debug the requests that my app is sending to the server. But I don't want to do that separately (printing the app's request and than start debug the server with that request),
I want eclipse (PDT installed and xdebug) to stop at the first line of the PHP script running by the server WHEN the app is sending a request to the server.
How can I do that ?

Zend Debugger - Cannot send message

I have a few problems with setting up the Zend Debugger. I have installed the Zend Server CE.
I am using Zend Studio as my development environment.
In Zend Studio under Debug Configurations, i can test the Debugger. Everything works fine.
But when i try to debug my project, the browser pops up and shows the right page but the debug session is terminated directly. I set a breakpoint in my IndexController but the debug session is terminated directly.
Under my Zend Server Logs tab, the Server Error Log says "[Zend Debugger] Cannot send message".
Can anybody help me?
Is the server remote or local? If it is remote are you sure the Zend Debugger port is allowed across the network? You may need to create an SSH tunnel as described here http://kb.zend.com/index.php?View=entry&EntryID=109.

Categories