dsdapobp26141 2013-05-08 14:34
浏览 197

.htaccess php_value display_errors设置中断错误500

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


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"

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.

  • 写回答

1条回答 默认 最新

  • doujiao7520 2013-05-08 14:42

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 ros的rviz仿真机器人
  • ¥15 关于#linux#的问题(输入输出错误):出现这个界面接着我重新装系统,又让修电脑的师傅帮我扫描硬盘(没有问题)用着用着又卡死(相关搜索:固态硬盘)
  • ¥15 cv::resize不同线程时间不同
  • ¥15 web课程,怎么做啊😭没好好听课 根本不知道怎么下手
  • ¥15 做一个关于单片机的比较难的代码,然后搞一个PPT进行解释
  • ¥15 python提取.csv文件中的链接会经常出现爬取失败
  • ¥15 数据结构中的数组地址问题
  • ¥15 maya的mel里,怎样先选择模型A,然后利用mel脚本自动选择有相同名字的模型B呢。
  • ¥15 Python题,根本不会啊
  • ¥15 会会信号与系统和python的来