Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following code:

<html>
<body>

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>

</body>
</html> 
<?php
if ($_FILES["file"]["error"] > 0)
  {
  echo "Error: " . $_FILES["file"]["error"] . "<br>";
  }
else
  {
  echo "Upload: " . $_FILES["file"]["name"] . "<br>";
  echo "Type: " . $_FILES["file"]["type"] . "<br>";
  echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
  echo "Stored in: " . $_FILES["file"]["tmp_name"];
  }
?> 

When I upload I just eventually get a The connection was reset page

  • I have nginx as a frontend and php-fpm as the backend
  • php settings are set very high so no limits.

What should I try to debug this? I don't have anything in the error_log for PHP.

share|improve this question
    
Have you checked your webserver or php-fpm error logs, there's a chance there's something there. –  Drew Khoury Aug 21 '13 at 7:33
add comment

2 Answers

up vote 0 down vote accepted

First set

error_reporting(E_ALL);

Review your error handling settings in php.ini and make sure that errors are not logged but displayed.

If that doesn't not help look into nging's error_log to see what if the reset comes from the server-process for some other reason.

share|improve this answer
add comment

First step is to upload a plain html file and ensure you can view that. I presume that is working so your webserver is there, you have the right dir, server etc. Second step would be to create a very simple PHP page showing the phpinfo. I know this is a silly question but did you name the file with a php extension?

http://php.net/manual/en/function.phpinfo.php

share|improve this answer
    
Yes, html works. Yes, php works and yes it does. –  Frank Thornton Aug 20 '13 at 10:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.