Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP doesn't show any kind of errors [duplicate]

Tags:

php

apache

I have a PHP server at home for development. It is running:

Ubuntu 9.10
Apache 2.2.12
PHP 5.3.2-0.dotdeb.1
MySql 5.0.7-dev

Currently the settings in the php.ini for displayiong errors are:

display_errors = on
error_reporting = E_ALL

But I do not see any errors in my php script. Also very strange is that phpinfo() shows me this:

display_errors Off

I checked the php.ini file, and restarted the apache server many times, but with no luck. Does anybody knows how this is possible?

edit:
When I localy set this:

ini_set('display_errors', 'on');

I do receive errors.

like image 737
iSenne Avatar asked Apr 15 '10 19:04

iSenne


People also ask

How do I enable display errors in PHP?

The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

How can I see all errors in PHP?

You can show all errors by adding a few lines to your local testing site's settings. php: error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); In addition, navigate to Administration→ Configuration→ Development → logging and errors and select "All messages".

What are the three main error types in PHP?

There are three (3) types of fatal errors: Startup fatal error (when the system can't run the code at installation) Compile time fatal error (when a programmer tries to use nonexistent data) Runtime fatal error (happens while the program is running, causing the code to stop working completely)


2 Answers

Is the display_errors parameter listed more than once in your php.ini file? If its defined more than once, the second instance of it will override the first.

like image 185
thetaiko Avatar answered Sep 25 '22 02:09

thetaiko


Ubuntu keeps separate copies of the php.ini file for each type of PHP installation.

I'm not familiar with the dotdeb release, but I'd guess it'd be in /etc/php5/apache2/php.ini

Edit: Since this is apparently not the case, try restarting Apache. PHP won't pick up changed settings until you do.

like image 44
Powerlord Avatar answered Sep 26 '22 02:09

Powerlord