title: Can't send POST data correctly to PHP script on localhost server
body: <p>I'm developing a small web application, and several of my HTML files send form data to PHP scripts for processing. Sending that data using a GET works just fine, but when any of my forms send the data using POST, I get the following error message in Chrome: "No data received. Unable to load the webpage because the server sent no data." Other browsers such as Firefox are also not getting the POST data correctly.</p>
  
  <p>Since the application is currently being developed, I'm running it on a localhost server installed on my machine, which is a LAMP configuration. I believe I am running Apache 2.2.11, PHP 5.2.9, and MySQL 5.1.51.</p>
  
  <p>While troubleshooting, I tried an extremely simple file upload form and PHP script to see if it would work, but it produced the same "No data received error" that all my other files gave me. Here is the simple file upload I tried:</p>
  
  <p><strong>index.html:</strong></p>
  
  <pre><code>&lt;form enctype="multipart/form-data" action="upload.php" method="POST"&gt;
  &lt;input type="hidden" name="MAX_FILE_SIZE" value="100000" /&gt;
  Choose a file to upload: &lt;input name="uploadedfile" type="file" /&gt;&lt;br /&gt;
  &lt;input type="submit" value="Upload File" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>upload.php</strong></p>
  
  <pre><code>&lt;?php
  $target_path = "images/";
  $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
  if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
  echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
       " has been uploaded";
  } else{
       echo "There was an error uploading the file, please try again!";
  }
  ?&gt;
  </code></pre>
  
  <p>Again, this is just a simple test file that I tried on my localhost to see if it would work, but it didn't. I uploaded the same two test files to my remote server, and the POST data was sent correctly on that server and the test file was uploaded to the server correctly.</p>
  
  <p>Therefore, I'm assuming that the issue of not being able to use POST on any of my forms is related to my localhost server configuration in some way since my remote server worked correctly with the two test files. I don't have a lot of experience in LAMP configuration and tweaking, so I'm not sure where to start looking to find the issue on my server. Does anyone have any suggestions as to what might be causing this issue?</p>