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 a Ubuntu server running in an ESV VM emvironment and I've installed a webserver with this configuration:

  • Nginx 1.0.5
  • PHP 5.3.6 with PHP-FMP
  • Mysql 5.1.62

I have an installation of latest version of joomla on this server and when I try to upload an install package (zip file containing joomla's extension files) I get "502 Bad Gateway" with the following error in nginx log file:

2012/05/13 11:22:21 [error] 19911#0: *20 upstream sent invalid status "-1 Copy failed" while reading response header from upstream, client: 10.10.56.70, server: localhost, request: "POST /administrator/index.php?option=com_installer&view=install HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "radio.xx.xx", referrer: "http://radio.xx.xx/administrator/index.php?option=com_installer"

I've searched all over the internet and I've changed too many parameters of php configuration, fpm config and nginx config including increasing execution times and etc but my problem still remains. I'm pretty sure it has nothing to do with my Joomla and problem is in webserver but there's no usable log messages, except above message.

Can anyone help me with this problem?

share|improve this question
    
Quick and might be a stupid question, is php5-curl installed? :) –  Taylor Jasko May 14 '12 at 3:59
    
Yes, as I can see in phpinfo, curl 7.21.6 is installed. –  faridv May 14 '12 at 15:48
    
Hmm, it's a tricky question. Nothing in the php-fpm error log? As I believe it's not enabled by default, you need to add error_log = log/php-fpm.log to your /etc/php5/fpm/php5-fpm.conf file. PHP might yield something... but, have you checked permissions/owner of the upload directory? If the permissions/owner is off, PHP won't be able to upload the file and save it out, which would make sense because of the "-1 Copy failed" error. –  Taylor Jasko May 14 '12 at 18:37
    
I have set all folders permission to 777 and owner groups for all of directories are my-default-user(radio):www-data. –  faridv May 15 '12 at 7:22
    
I also did enable php-fpm error logging but all I have in the log file is fpm started and such data. nothing about this problem! php log also didn't give me any usable information! I really need to make it work! :( –  faridv May 15 '12 at 7:24
add comment

3 Answers

This may be of use to you.

I'm running into a similar problem with updating a single component. It seems to be related to permissions on files that it's trying to replace. That forum post suggests adding some extra info to the error messages it throws back so you can determine what files it's failing on.

share|improve this answer
add comment
up vote 0 down vote accepted

After months of searching I found out that problem was because of vsftpd and the chmod that it was using for uploaded files. After uploading the files, PHP was not able to even read the files.

Instead of struggling with vsftpd I managed to upload my files with http and problem solved!

share|improve this answer
add comment

For me i uploaded the file over http i got something like: 1886#0: *37766 upstream sent invalid status "-1 Copy failed" while reading response header from upstream, client In my nginx log, turned out that one of the directories did not exists "cli" in this case.

share|improve this answer
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.