webzhangnan

PHP编码出错不提示,而是提示500错误,这对于开发来说,是很不方便的。下面讲解如何开启错误提示步骤:

1. 打开php.ini文件。
以我的ubuntu为例,这个文件在: /etc/php5/apache2 目录下。

2. 搜索并修改下行,把Off值改成On
display_errors = Off

3. 搜索下行
error_reporting = E_ALL & ~E_NOTICE
或者搜索:
error_reporting = E_ALL & ~E_DEPRECATED
修改为
error_reporting = E_ALL | E_STRICT

4. 修改Apache的 httpd.conf,
以我的 Ubuntu 为例, 这个文件在:/etc/apache2/  目录下,这是一个空白文件。
添加以下两行:
php_flag display_errors        on
php_value error_reporting       2039

5. 重启Apache,就OK了。
重启命令: :sudo /etc/init.d/apache2 restart

希望能对大家有所帮助。

分类:

技术点:

相关文章:

  • 2021-07-21
  • 2021-08-07
  • 2022-12-23
  • 2021-12-17
  • 2021-12-02
猜你喜欢
  • 2021-06-12
  • 2021-12-03
  • 2021-09-02
  • 2021-07-25
  • 2021-11-02
相关资源
相似解决方案