1
peterr
Apache2, php5 and internal server errors
  • 2008/4/22 5:15

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Just starting to shift an XOOPS site, to an Apache2 and php5 configured server. I have always used the 'php_flag' setings in .htaccess , as modules like protector, and other XOOPS security settings, need the php settings changed.

On the new server, getting a 500 error on .htaccess

Quote:

Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

I noticed a few posts on various sites stating the following:

Quote:

adding php_flag in .htaccess under apache 2 will cause internal server error. according to apache 2 manual, php_flag should go to <virtual> or <directory> section.

I will have to find out if the new server is running phpsuexec or not, as This FAQ states that with phpsuexec, one cannot use .htaccess to modify php settings.

However, I think the reason for the problem is Apache2 somehow.

Has anyone else had this sort of problem, and if I currently have the following in .htaccess

# XOOPS security measures
php_flag session.use_trans_sid off
# Protector module
php_flag register_globals off
php_flag allow_url_fopen off

and phpsuexec is not running on the new server, do I use the <virtual> or <directory> section, to modify the settings.
NO to the Microsoft Office format as an ISO standard.
Sign the petition

2
peterr
Re: Apache2, php5 and internal server errors
  • 2008/4/24 1:01

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


I have since found out that suPHP is running, and there is a method to use .htaccess , and therefore, no doubt, add the php_flag settings.

The following from suPHP - FAQ ..

Quote:

Can I use the php_value directives in .htaccess files with suPHP?

suPHP does not support the php_value/php_admin_value directive known by mod_php to parse configuration options to scripts for certain virtual hosts or directories. However there is a PECL extension named htscanner that can be used with PHP CGI (called by suPHP) to parse such options being present in .htaccess files. Be sure to take a look at the README file provided with the htscanner distribution on how to make Apache ignore the php_value directives in .htaccess files instead of throwing an error.
NO to the Microsoft Office format as an ISO standard.
Sign the petition

3
peterr
Re: Apache2, php5 and internal server errors
  • 2008/4/24 13:17

  • peterr

  • Just can't stay away

  • Posts: 518

  • Since: 2004/8/5 9


Or, another alternative ..

In the .htaccess file of the web root path ..

suPHP_ConfigPath /home/username

Then create a file /home/username/php.ini (take a copy of the currently used php.ini configuration file).

Now you have a local php.ini file where you can set your directives.

Or, this should work also ..

suPHP_ConfigPath /home/username/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>

and your php.ini is placed in the web root path.
NO to the Microsoft Office format as an ISO standard.
Sign the petition