PHP 错误未显示在浏览器中 [Ubuntu 10.10] [英] PHP errors NOT being displayed in the browser [Ubuntu 10.10]

查看:19
本文介绍了PHP 错误未显示在浏览器中 [Ubuntu 10.10]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 PHP 和整个 LAMP 堆栈的新手,但我已经设法在我的 Ubuntu 10.10 系统上启动并运行它.除了在浏览器中重新发布错误之外,一切似乎都在工作,我似乎无法正常工作(没有它我就无法工作!).

I'm new to PHP and the whole LAMP stack but I've managed to get it up and running on my Ubuntu 10.10 system. Everything seems to be working with the exception of error reposting in the browser which I just can't seem to get working (and which I can't work without!).

我已经阅读了许多文章和其他线程,它们表明应该在文件 /etc/php5/apache2/php.ini 中应用以下值:

I've read a number of article and other threads which indicate that the following values should be applied in the file /etc/php5/apache2/php.ini:

  • display_errors = On
  • display_startup_errors = On

我已经重新启动了 apache2,甚至重新启动了我的计算机,但在我的一生中,我就是无法让它工作.我什至尝试使用 phpinfo() 函数,该函数报告这些设置与我设置的一样,所以我知道它正在获取正确的配置文件,但什么也没有!

I've restarted apache2 and even restarted my computer but for the life of me I just can't get it working. I've even tried using phpinfo() function which reports that these settings are as I've set them so I know it's picking up the correct configuration file but nothing!

欢迎任何帮助.

推荐答案

不要只启用 php.ini 文件中第一次出现的 display_errors.确保向下滚动到真实"设置并将其从 Off 更改为 On.

Don't just enable the first occurrence of display_errors in the php.ini file. Make sure you scroll down to the "real" setting and change it from Off to On.

问题是,如果您在第一次出现 display_errors 时就进行更改(即取消注释 + 添加 = On),您的更改将在第 480 行的某处被覆盖再次将其设置为 Off.

The thing is that if you settle with changing (i.e. uncomment + add = On) by the very first occurrence of display_errors your changes will be overwritten somewhere on line 480 where it's set to Off again.

这篇关于PHP 错误未显示在浏览器中 [Ubuntu 10.10]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆