0

I am uploading a file to my server and getting the following log, and after a lot of googling I cannot find an answer can any one help or suggest where to start?

2014/06/26 17:15:01 [error] 15035#0: *2491 FastCGI sent in stderr: "PHP message: height: 375 - width: 600" while reading response header from upstream, client: , server: url, request: "POST /user/updateProfile HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "url", referrer: "url/user/edit/7"

I have hidden the url's for security purposes.

Thanks!

EDIT *

PHP code for upload

if(empty($_FILES['user_cover_image_url']['name'])) {
        } else {
            //Cover Elements
            $coverName = $_FILES['user_cover_image_url']['name'];
            $coverExtension=end(explode(".", $coverName));
            if($coverExtension=='png') {$coverExtension = 'jpg';}
            $cName = $uid.'-'.$pass->generateRandomString($length=25);
            $coverImage = $cName.'.'.$coverExtension;
            $cSource = $_FILES['user_cover_image_url']['tmp_name'];
            $cDestination = '/var/www/html/tmp/cover-'.uniqid().'.'.$coverExtension;
            $pass->imageresize($cSource, $cDestination, $width=600, $height=600, $crop=false, $quality=72);
            if ($s3->putObjectFile($cSource, "proaudiosocialstream", $coverImage, S3::ACL_PUBLIC_READ)) {$s3Cover ='http://bucket.s3.amazonaws.com/'.$coverImage;}else{return false;}
            $data['user_cover_image_url'] = $coverImage;
        }

        if(empty($_FILES['user_avatar_url']['name'])) {
        } else {
            //Avatar Elements
            $avatarName = $_FILES['user_avatar_url']['name'];
            $avatarExtension=end(explode(".", $avatarName));
            if($avatarExtension=='png') {$avatarExtension = 'jpg';}
            $aName = $uid.'-'.$pass->generateRandomString($length=25);
            $avatarImage = $aName.'.'.$avatarExtension;
            $aSource = file_get_contents($_FILES['user_avatar_url']['tmp_name']);
            $aDestination = '/var/www/html/tmp/avatar-'.uniqid().'.'.$avatarExtension;
            $pass->imageresize($aSource, $aDestination, $width=400, $height=400, $crop=false, $quality=72);
            if ($s3->putObjectFile($aDestination, "proaudiosocialstream", $avatarImage, S3::ACL_PUBLIC_READ)) {$s3Avatar ='http://bucket.s3.amazonaws.com/'.$avatarImage;}else{return false;}
            $data['user_avatar_url'] = $avatarImage;
        }
6
  • 1
    Could you please post the PHP code related to uploading? Commented Jun 26, 2014 at 16:36
  • @Saiqi Added as requested Commented Jun 27, 2014 at 9:19
  • i don't see a reason why codeigniter is tagged in here sorry if im wrong but if you are using CI you can use file uploading library ellislab.com/codeigniter/user-guide/libraries/… Commented Jul 1, 2014 at 9:59
  • It is tagged because that is the framework I am using to build this application, however I have chosen to not use the library as I need to do some other things with the file before it gets uploaded. thanks for your comment though. Commented Jul 1, 2014 at 12:39
  • @JustinErswell its not php or upload issue, its nginx and php-fpm config issue.@ I have faced the same issue. Please try my answer , it will work. Commented Jul 1, 2014 at 19:32

1 Answer 1

0
+50

I think you did not configured php-fpm with nginx

nginx virtual host file should look like this for php-fpm

server {
    listen   80;
    server_name www.trakleaf.in trakleaf.in;
    access_log access_file_path compression;
    error_log error_file_path;
     root   root_directory;
     index  index.html index.htm index.php;
     location / {  
             try_files $uri $uri/ /index.php;
     }
    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        if ($uri !~ "^/images/") {
            fastcgi_pass unix:/var/run/php5-fpm.sock;
        }
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME root_directory$fastcgi_script_name;
    } 

}
Sign up to request clarification or add additional context in comments.

4 Comments

It's completely unrelated to the question. Question clearly shows that requests are passed to php, and there is no need to (re)configure it.
(Additionally, the configuration provided is awful. You should never use if($uri) checks, locations should be used instead.)
@MaximDounin I have faced the same issue and I have solved this by this configuration.
You didn't. Or, rather, there were no issue - the message in question looks like some debug logging from php, see my comment above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.