500 Internal Server Error - php_value issue

HM2K

Joined: 2003-06-12
Posts: 53
Posted: Thu, 2006-01-12 15:59

The following information is required to get an answer:
Get this information from the PHP diagnostic (in the configuration wizard).
Gallery URL (optional but very useful): not included (security reasons, and not much use in this problem)
Gallery version: 1.5.1
Apache version: 1.3.34
PHP version (don't just say PHP 4, please): v4.3.10
Graphics Toolkit: ImageMagick
Operating system: FreeBSD 5.3
Web browser/version (if applicable): Firefox 1.5

When I visit http://gallery.example.com/setup/index.php It gives me an error 500 Internal Server Error.
Unless I go to the .htaccess in setup, and hash out (#) all the php_value lines.

But then when I visit the url, I get the following message:

Quote:
Apache is not obeying the 'php_value' lines in your .htaccess file. Try entering the following into your web server's httpd.conf file:

<Directory /usr/home/user/public_html/gallery>
AllowOverride Options FileInfo
</Directory>

I tried adding the Directory parameter to .htaccess and the httpd.conf, but they both resulted in an error 500.

How do I go about fixing this problem?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2006-01-12 16:23

You own example.com ? WOW ;)

Solution: Just delete .htaccess file in the setup/ folder of your Gallery.

Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Thu, 2006-01-12 17:01

Please see rfc2606.

Deleting .htaccess in setup would mean that I cannot upload files larger than 2mb which is rather annoying.

Any better solutions?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2006-01-12 17:16

well, if your host doesnt allow php settings ?! What can you do ?

So deleting this .htaccess is the only way to run Gallery on this server :)

Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Thu, 2006-01-12 17:27

I own the host/server.

How do I allow php settings?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2006-01-12 18:07

Just to the changes gallery suggest.

Then stop and start the webserver.

(Not restart)

Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Thu, 2006-01-12 18:57

As I said in my original post. I made those changes to my "httpd.conf" and issued "apachectl graceful", the directory still gave me an error 500.

Where do I go from here?

Just checked my logs, it says:
gallery/setup/.htaccess: php_value not allowed here

So I tried re-adding the Directory line to the httpd.conf

I have the following now:

Quote:
<Directory />
Options FollowSymLinks ExecCGI
AllowOverride None
</Directory>

<Directory /usr/home/user/public_html/gallery>
AllowOverride Options FileInfo
</Directory>

/usr/local/sbin/apachectl graceful: httpd gracefully restarted

Still says:
gallery/setup/.htaccess: php_value not allowed here

And I still get an error 500.

Any further suggestions?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2006-01-12 19:09

nono

try stop and start.

not restart or somethig.
Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Thu, 2006-01-12 19:24

/usr/local/sbin/apachectl stop: httpd stopped
/usr/local/sbin/apachectl start: httpd started

I didn't think that would make any difference.

Still the error 500.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Fri, 2006-01-13 11:43

No solution to this problem then?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Fri, 2006-01-13 12:38

Well,

to be honest you are the first that i hear of where this does not work.

An reason could be that you placed this direction at a wrong place its overwritten by a later/other setting.

Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Fri, 2006-01-13 13:10

I assure you, It has not been placed in the wrong place, and nothing was overwritten.

I have searched high and low about this issue.

It seems most people simply overlook it and just delete the .htaccess, limiting themselves to the 2mb upload.

This is not a real solution, its a "quick fix" solution.

I'm looking for a real solution.

Any further help will be much appreciated.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Fri, 2006-01-13 13:51

Well, the limit is set in (your) php.ini.
Many people can not change the limit.

So this *is* a real solution.

Jens
--
Last Gallery v1 developer and translation manager.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Fri, 2006-01-13 15:05

I have already changed this to 10mb, however the script still errors or 500's

Why would they put a .htaccess file that doesn't work?

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Fri, 2006-01-20 10:31

And the beat goes on...

Still no real solution.

 
HM2K

Joined: 2003-06-12
Posts: 53
Posted: Sat, 2006-01-21 13:54

I overcame this issue by adding

Quote:
AllowOverride Options

To my user directories in my httpd.conf

This isn't really a practical solution as it gives all the users too much control, rather than just a single directory.

This will have to do until I can figure out a better solution.

 
MadDev

Joined: 2006-01-24
Posts: 1
Posted: Tue, 2006-01-24 18:29

You could set up that directory as an alias as follows:

http.conf----------------------
  Alias /foo "/opt/foo"
  <Directory "/opt/foo">
    AllowOverride All
    DirectoryIndex index.php
    ...
  </Directory>
-------------------------------

and

/opt/foo/.htaccess-------------
  php_value magic_quotes_gpc On
  php_value ... (etc.)
-------------------------------

In this example, magic_quotes_gpc is turned on only for http://example.com/foo.
The other directories are using whatever php values values from the php.ini.

I'm curious why Apache was grousing about the .htaccess files. Perhaps you had some naughty command in there? I can't reproduce your error; I'm running Apache 2.x, but I don't think that is the issue.

Cheers,
MD

 
Lev

Joined: 2006-10-28
Posts: 1
Posted: Sat, 2006-10-28 15:27

What if you create local php.ini for each gallery
and set your parameters there ?
post_max_size="10MB"
upload_max_filesize="10MB"

Suppose to work....

Everything can be done.