Note that there are some explanatory texts on larger screens.

plurals
  1. POSending POST data with curl and php
    primarykey
    data
    text
    <p>Greets.</p> <p>So, I'm running Fedora Core 8 on an Amazon EC2. I installed httpd, php5 and libcurl, and a bunch of other stuff. Seemed to be working great, but then I realized that POST data isn't being sent by curl in my php scripts. Same request in the command line works tho. I also ran the same php scripts on my local machine (Win XP) and another remote machine (Ubuntu), and they run fine, the POST data is being sent, but not on the FC8. Does it require any special configuration? Any firewall issues?</p> <p>Here's the PHP code:</p> <pre><code>error_reporting(E_ALL); $ch = curl_init("http://foller.me/tmp/postdump.php"); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, "something=somewhere"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_NOBODY, 0); $response = curl_exec($ch); echo $response; curl_close($ch); </code></pre> <p>Here's the corresponding curl command:</p> <pre><code>curl -d "something=somethingelse" http://foller.me/tmp/postdump.php </code></pre> <p>I also found the corresponding entry in the apache error_log, and here's what I came up with:</p> <pre><code>* About to connect() to foller.me port 80 (#0) * Trying 75.101.138.148... * connected * Connected to foller.me (75.101.138.148) port 80 (#0) &gt; GET /tmp/postdump.php HTTP/1.1 Host: foller.me Accept: */* &lt; HTTP/1.1 200 OK &lt; Date: Tue, 07 Jul 2009 10:32:18 GMT &lt; Server: Apache/2.2.9 (Fedora) &lt; X-Powered-By: PHP/5.2.6 &lt; Content-Length: 31 &lt; Connection: close &lt; Content-Type: text/html; charset=UTF-8 &lt; * Closing connection #0 </code></pre> <p>The POST data isn't being sent, see? Any ideas?</p> <p>Thanks in advance everyone. ~ K.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload