NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
cURL not stepping into requested page.
Veteran

Joined: 15 Nov 2003
Posts: 118
Reply with quote
My setup:
Apache 2, PHP 5, both installed on my local windows PC as a test server, configured to serve files from http://localhost/



Hi

Im using phped 5.9

I am using cURL to post data to a page that is on the same server, the page address (on my local test server) is /pages/test.php

The i call curl_exec it returns the response from test.php, but the debugger doesnt step into test.php

Likewise, if i use a jQuery.ajax to post to test.php, the debugger steps into test.php.
View user's profileFind all posts by joebSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
cURL runs a request clear of debugger things because you didn't supply them, so debugger has no clue that you want to start it.
To make debug session propagated "through" cURL call, you have to add eitehr DBGSESSID cookie or GET or POST variable with this name, like mentioned on this FAQ page http://www.nusphere.com/kb/technicalfaq/howto_run_dbg.htm
For details on DBGSESSID syntax, please check FAQ page: http://www.nusphere.com/kb/technicalfaq/faq_dbg_related.htm

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 31 Oct 2012
Posts: 16
Location: Canada
Reply with quote
Hi Although it's an old post, I ran into the same problem and found a solution, wich is more, "informative" than Dimitri's one... Wink

The easiest way to pass DBGSESSID is like this

Code:

    $ch = curl_init($url);   

    curl_setopt($ch, CURLOPT_COOKIE, 'DBGSESSID=' . $_COOKIE['DBGSESSID']);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
    ...



This way, it won't interfere with your CURLOPT_POSTFIELDS.

You debugger will then tell you that a new debugging session has started.

Answer yes to activate the new debug session and debug your code.

VoilĂ !
View user's profileFind all posts by fledSend private message
cURL not stepping into requested page.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic