5

I installed new XAMPP version 1.8.1 for windows with Apache 2.4.3 and PHP 5.4.7.

None of my sites are working, returning HTTP Error 500 (Internal Server Error). I traced the reason to this .htaccess line

php_value display_errors off

When I comment it, site works. I have other php_value command's that works just fine eq. php_value error_reporting -1.

Google for solution, people say PHP must be loaded as Dynamic Shared Object (DSO) aka. Apache module. Which in my case is so (httpd-xampp.conf):

LoadFile "/xampp/php/php5ts.dll"
LoadModule php5_module "/xampp/php/php5apache2_4.dll"

So this is not what is creating a problem.

I would prefer solution that keeps php_value display_errors off inside .htaccess file for the sake of other people it my team.

pls help

== NEW DEVELOPMENT ==

After commenting unrelated parts of .htaccess file that was using mod_expires.c and was badly writen, aka. correct way is to put it in if example:

<IfModule mod_expires.c>
   ExpiresActive On
   <FilesMatch "\.(gif|jpg|jpeg|tif|tiff|bmp|png|js|css|ico)$">
       ExpiresDefault "access plus 10 years"
   </FilesMatch>
</IfModule>

500 error was gone and php_value instructions work.

So if you are in similar situation comment or remove all unrelated lines and try to pint point where the problems is.

0

1 Answer 1

4

First of all it should be

php_flag   display_errors       Off

Not like

 php_value   display_errors       Off

However, our servers run PHP in "CGI mode" as recommended by the PHP developers (not as an Apache module), so you can't use "php_value" or "php_flag" commands in .htaccess files. If you try to do so, you'll see an "internal server error" message.

Sign up to request clarification or add additional context in comments.

2 Comments

Changing to php_flag display_errors off didn't solved the problem. As I said I run PHP as Apache module and setting php_flag in .htaccess file should work.
If it is about the flag display_errors you could just put this line (to debug your php code on a remote server) in a php.ini in the same directory. E.g. I put the two following lines in the php.ini file: display_errors = On error_reporting = -1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.