views:

265

answers:

8

hi im working in php on suse11.0 my problem is when i type a wrong syntax or query it doesnt show error only blank page shown at this situtaion

thanks

+2  A: 

It is almost certainly the case that display_errors is disabled in php.ini.

This is a good thing on product servers, and makes development systems basically unusable.

For a development system you probably want to add one of these lines to you php.ini file:

error_reporting  =  E_ALL & ~E_NOTICE

or

error_reporting  =  E_ALL
acrosman
To add to this, you can probably find the errors in the webserver's log (for Apache, this is often /var/log/httpd/error_log)
Amber
A: 

Make sure error_reporting is turned on in php.ini

error_reporting  =  E_ALL | E_STRICT
Mike
A: 

Make sure in you php.ini file that display_errors is on and set error_reporting to E_ALL.

Ryan Smith
A: 

Start your script with:

<?php
    ini_set ('display_errors', 1);
    error_reporting (E_ALL | E_STRICT);
?>
dutch
A: 

Hi,

You might to configure error_reporting (see also), and enable the displaying of errors (see display_errors or ini_set) -- at least on your development machine

In your php.ini file, you'd use

error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On

Or, in your PHP code :

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');

You might also want to install Xdebug on your development box, to get nice stacktraces wehn an error / exception occurs


Of course, on your production machine, you probably don't want to display errors ; so that will have to be configured depending on your environment ;-)

Pascal MARTIN
+2  A: 

Create a file for example test.php with this content:

<?php
phpinfo();
?>

Execute it in your browser and search where the php.ini file is located. Than turn error reporting and displaying errors in php.ini on.

astropanic
A: 

While the other answers do answer your question, I just wanted to point out that it is best to provide your own error checking routine (or code) so that your script will show pleasant error messages to users. something like

$result=@mysql_query($some_query);
if(!$result){
   if($debugging==TRUE){
       echo($some_query.'<br>'.mysql_error());//shows error in debugging mode
    }
   else{
     log_error()// error logging function
      die( 'there was a problem with your request the problem has been logged and we are working on it');//or something like that

   }
}
//no error
more code
A: 

Faced the same issue. One should set display_errors = E_ALL in php.ini file and then you can customize your application as per your requirement

ini_set("display_error", 1) ;
ini_set("error_reporting", E_ALL || ~E_NOTICE );

I guess some settings cannot be overridden from php.ini file through ini_set. I don't whether i am right or wrong

The same is the story with the max upload size "upload_max_filesize" which cannot be set through ini_set function. One has to explicitly mention the file size in php.ini itself. I guess this for security purpose, so that the programmer will not mess up with the server settings.(nightmare for server administrators)

Once i had read about a setting in php.ini that will allow ini_set to behave has written by the programmer. Does anyone knows that setting?

Also can anyone tell me about the settings that can be changed through ini_set, irrespective of its value in php.ini

Waiting for your responses..........

THANKS ALL