php_flag not allowed here [Solved]

grooveman

Joined: 2010-02-22
Posts: 43
Posted: Mon, 2011-11-14 00:58

Hi,

I'm trying to upgrade my gallery to 3.0.2 from 3.0.1.

I have extracted the archive into http://myserver/gallery3_new, like the docs said, copied over my var and my theme, then renamed my current gallery to gallery3_old and renamed my gallery3_new to gallery3. Then I pointed my browser to http://myswerver/gallery3/upgrader, and I get a 500 server error (Interal Error).

I look in my apache2 logs, and see this:

Quote:
/var/www/localhost/gallery3/.htaccess: php_flag not allowed here

I haven't done anything yet to screw this up, with the exception of moving the var dir and the theme, this is a stock install... so I'm not sure what is happening here.

I have full control over this server... if there is something I need to enable or disable in apache or in my php.ini, i can do it... I'm just not sure what it could be. I was surprised when I didn't find anyone with the same issue...

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Mon, 2011-11-14 01:23

It is definitely this section of the .htaccess causing the problem:

Quote:
<IfModule mod_php5.c>
php_flag short_open_tag On
php_flag magic_quotes_gpc Off
php_flag magic_quotes_sybase Off
php_flag magic_quotes_runtime Off
php_flag register_globals Off
php_flag session.auto_start Off
php_flag suhosin.session.encrypt Off
php_value upload_max_filesize 20M
php_value post_max_size 100M
</IfModule>

I commented out all of the php_flag statements, and things work again. I'd like be able to apply these settings... is there something in my apache configuration I can adjust?

By the way, there is an extremely annoying javascript bug on this forum. Every time I hit a shift+I or a shit+B it starts dropping the bb code for italics and bold respectively... very hard to write with! [i]I'm using linux with the firefox browser... not sure about others.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2011-11-14 04:15
Quote:
By the way, there is an extremely annoying javascript bug on this forum. Every time I hit a shift+I or a shit+B it starts dropping the bb code for italics and bold respectively... very hard to write with! [i]I'm using linux with the firefox browser... not sure about others.

I think it's more a FF bug. Press CTRL and see if that makes it go away. I haven't had that issue (that I can recall) since I've switch to Chrome.

As to the other issue:
http://php.net/manual/en/configuration.changes.php

The first paragraph shows what needs to be done.
____________________________________________
Like Gallery? Like the support? Donate now!

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Mon, 2011-11-14 19:36
Quote:
As to the other issue:
http://php.net/manual/en/configuration.changes.php

The first paragraph shows what needs to be done.

Yes, I saw that, however, it doesn't seem to be working. I put this in my conf:
<Directory /gallery3>
AllowOverride FileInfo
AllowOverride Options
</Directory>

I also tried:
<Directory /gallery3>
AllowOverride FileInfo
AllowOverride All
</Directory>

Still get the 500 error.

My gallery is located at http://myserver.com/gallery3 -- so I would have thought that would work. Did I do this wrong?

 
tempg

Joined: 2005-12-17
Posts: 1857
Posted: Mon, 2011-11-14 20:39

May help if you remove the whole block from htaccess and replace in the config file.

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Mon, 2011-11-14 22:43

Hi tempg,

If I understand you, you are saying take that entire block of code, out of my .htaccess file, and paste it into my /etc/apache2/sites-available/default file? (I'm using debian, so that is my config.)

Yes, I suppose I could do this, but what I'm really wanting here is to have plug and play with gallery. So, I'm really asking is this: what changes do I have to make in my apache2 config to allow me to use the .htaccess as it is? I'm trying to keep deployment as simple as possible, so this would be of help to me now, and more importantly, in future deployments of gallery.

Thanks!

-G

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2011-11-15 12:03

Try this

<Directory /FULL/PATH/TO/YOUR/G3/DIRECTORY/gallery3>
AllowOverride All
</Directory>

Then be sure to restart Apache after making the change.
____________________________________________
Like Gallery? Like the support? Donate now!

 
grooveman

Joined: 2010-02-22
Posts: 43
Posted: Tue, 2011-11-15 13:49

Duhh... Sorry! I should have tried that... I thought the path was relative to the http root. That works. Sorry, a bit brain dead the past couple days, gallery is 1 of a dozen upgrades I'm doing now...

Thanks Niv.