Help With Gallery

apps

#1

I followed the wombatnation description, but now i have an internal server error. I do not know what to do. I try phpo-cgi mode and regual php mode.

www.munkey.net/gallery

Please help me


#2

Have a look in your error.log and see if you can find out what the actual errors were.

  • marsbar

#3

Hi this is the anonymous guy.

The error log states this:
Premature end of script headers: /dh/cgi-system/php.cgi

The gallery was working fine last night. Do you htink dreamhost chanegd some of my settings?


#4

i also added the line for php cgi and i tried erasing .htaccess


#5

I am having the same issues, I do have a custom php, but it was working at first, now it refuses to work. How did you get yours to work?


#6

Based on your description that everything was working, and then all of a sudden stopped working, my suggestion below may not solve your problem. But, it’s worth a try.

A common cause for the “premature end of script headers” error is that a text file was FTP’d in binary mode from a Windows machine to a Linux box Windows, Linux, and the Mac OS use different characters to signal the end of a line in a text file.

When the CGI processor (PHP, Perl, Python, etc.) hits the unexpected end of line character or characters, it exits the script prematurely. If the script was producing an HTTP response, it probably won’t have reached the point where it has created the appropriate HTTP headers.

As I mentioned before on other discussion threads, FTP clients aren’t always that smart about auto detecting when to transfer a file as ASCII or binary. Your FTP client may not be configured to automatically transfer PHP files as ASCII.

So, did you happen to edit one of the Gallery PHP files on a Windows machine and then FTP it back to your DreamHost server? If so, are you certain it was transferred as ASCII instead of binary?

If you know which file(s) you edited, use dos2unix from a shell prompt to fix it. Alternatively, FTP the file again and force your FTP client to use ASCII mode.

Robert
http://www.wombatnation.com/


#7

This gets stranger, I plan on moving the PHP binary to another location and trying it there.

No FTP involved, did a wget and untarred on the server.

Since I am running as an Apache module, I modified the .htaccess to use the CGI version of php instead. Knowing all the modules I need are not in DH’s PHP, I finished setup, and things were at least working, but not the features I wanted.

I then copied my custom PHP that I use for Horde to a cgi-bin directory inside the gallery directory, and modified .htaccess to point to the custom PHP, this caused the Internal Server Error, Premature end of script headers. Curious, this worked with the stock PHP CGI, so I assumed it was something compiled into the binary that gallery didn’t like.

Re-compiled PHP to cut out some un-needed stuff threw this into the gallery directory, and still a server error. Thinking something wierd was up, I again pointed to the Horde PHP binary, but this time, I left it in the Horde directory and pointed there. Things worked fine.

I thought I lost my mind, so I copied the stripped down PHP to horde, and it still worked fine. I copied both binaries back to the gallery directory, changed .htaccess again, and again, a server error.

It turns out, I had changed the cgi-bin directory to group write, and the server does not like that. I just found a link to the discussion on this, so for any others out there,

DIRECTORY CONTAINING PHP BINARY CANNOT BE GROUP or WORLD WRITABLE
https://panel.dreamhost.com/kbase/index.cgi?area=144

Thanks for listening, thanks for the help, and maybe I will point this out to DH support.