Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Currently installed php version 5.3.10. It is not reporting any kind of errors like syntax error e.g.

<?php
define("variable" , 10);
variable++;
echo variable;
?>

This code has an error and browser should display it . But browser window is empty

Display error is off as I see in the information given by the phpinfo() in column php core.

I want it to be turned on.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you want to enable it for all your php projects:

edit the /etc/php5/apache2/php.ini by opening a terminal and typing the following:

gksudo gedit /etc/php5/apache2/php.ini

search for the line.

display_errors = Off

and change Off to On

If you want to enable it for a single website, in your website's .htaccess file add the following line:

php_flag display_errors on

If you edited your php.ini file, a restart for apache is required for the settings to take effect, restart it with following line in a terminal.

sudo apache2ctl restart
share|improve this answer
1  
Excellent Dan :) small addition: both .htaccess and apache2.conf override the seting that is in php.ini. And if php.ini contains this settings more than once the last one is the active one. –  Rinzwind Feb 16 '13 at 18:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.