Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

htaccess causing 500 Internal Error


6 replies to this topic

#1 MR1

  • Community Member
  • 160 posts
  • Real Name:Mustafa

Posted 16 March 2010, 20:13

Hello Guys,

here is my .htaccess file

php_flag display_errors Off
php_flag display_startup_errors Off
php_flag log_errors On
php_flag magic_quotes_sybase Off
php_flag magic_quotes_gpc On
php_flag register_globals Off
php_value error_log /home/sites/mine.co.uk/public_html/errors/php.txt
php_value error_reporting 2147483647 
Options All -Indexes
php_value disable_functions phpinfo
AuthUserFile "/home/mine/.htpasswds/public_html/mine.co.uk/adindex/passwd"
AuthType Basic
AuthName "enquiries@mine.co.uk"
require valid-user


why is the above a problem, i mean can i not use php.ini file and put all this in that and get that to work? Which is better.

Thank you for you help.

#2 spooks

  • Community Member
  • 6,668 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 16 March 2010, 20:34

what is allowed in your htaccess is dependent upon your server config.

You would be best speaking to your host on this issue.


Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Post osC questions don't PM them. Vampire?

Contributions:

Multi Images with Fancy Popups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#3 MrPhil

  • Community Member
  • 2,900 posts
  • Real Name:Phil
  • Gender:Male

Posted 16 March 2010, 22:08

Yes, most modern server installations prefer that you put all the PHP settings into php.ini. The format will be a bit different that what you have in your .htaccess file. Depending on your server setup (e.g., running suPHP) you may need to put an entry in .htaccess pointing to the php.ini file. For all these things, your host can tell you exactly what's needed.

Learn to run the "phpinfo" script to see what your current settings are -- you may not need some of your settings. It also will tell you if your .htaccess or php.ini settings are being accepted.

<?php phpinfo(); ?>

Do not leave this lying around (at least not with an obvious name) for hackers to use and see the details of your installation.

P.S. Having PHP settings (phpvalue, phpflag) in .htaccess is often banned, and if used, causes 500 error.

Edited by MrPhil, 16 March 2010, 22:10.


#4 MR1

  • Community Member
  • 160 posts
  • Real Name:Mustafa

Posted 17 March 2010, 19:01

Hello,

Thank you for your help, it seems that i am getting the error due to this code, can i not replace this some other way?

Options All -Indexes


Thank you

#5 mdtaylorlrim

  • Community Member
  • 2,497 posts
  • Real Name:Mark
  • Gender:Male

Posted 17 March 2010, 20:53

View PostMR1, on 17 March 2010, 19:01, said:

Hello,

Thank you for your help, it seems that i am getting the error due to this code, can i not replace this some other way?

Options All -Indexes


Thank you
I would leave off the 'ALL', and it will only work if your host has 'Options AllowOverride' enabled.
Avoid the most asked question. See How to Secure My Site and How do I...?

#6 MR1

  • Community Member
  • 160 posts
  • Real Name:Mustafa

Posted 20 March 2010, 11:48

Hello,

Thank you for the reply and help. It seems that when i remove these from the list it all works fine.

php_flag display_errors Off
php_flag display_startup_errors Off
php_flag log_errors On
php_flag magic_quotes_sybase Off
php_flag magic_quotes_gpc On
php_flag register_globals Off
php_value error_log /home/sites/domainetc/php.txt
php_value error_reporting 2147483647 
php_value disable_functions phpinfo
Options All -Indexes

anything from here i should have or a work around?

Thank you

#7 MrPhil

  • Community Member
  • 2,900 posts
  • Real Name:Phil
  • Gender:Male

Posted 20 March 2010, 17:12

In your .htaccess file:
Options -Indexes
It may need a line pointing to your php.ini file -- ask your host.

In your php.ini file:
display_errors=Off
display_startup_errors=Off
log_errors=On
magic_quotes_sybase=Off
magic_quotes_gpc=On
register_globals=Off
error_log='/home/sites/domainetc/php.txt'
error_reporting=2147483647 
disable_functions='phpinfo'
I'm not sure about some of the values needed, or their exact format. Most of those should be set anyway in your default PHP configuration. Run phpinfo() to see what's already set for you, and add anything that you need that isn't already set. It will also tell you the exact format needed for each item's value.