0

when php scripts got error, the error usually goes to the apache error log (ubuntu setup).

how can i config the server so that the error will be directly output to the page, just like XAMPP is doing.

thanks in advance!

(the error i am referring to is php error. so that i can debug my php code easily)

3 Answers 3

1
 display_errors = On 

Put this line in your php.ini file.

Sign up to request clarification or add additional context in comments.

3 Comments

where is that file located on ubuntu?
do i need to restart server after this?
Unless it is a development server - i wouldnt recommend changing the php.ini - it would cause ALL errors/notices/warnings to ALWAYS show... While ideally your code should never have any of these.. it would be bad in a production server
1

If you just want to view the warnings and notices stick these two lines into the top of your php page

error_reporting(E_ALL);
ini_set('display_errors','1');

Comments

0

What kind of error?

Check the PHP docs on error handling https://www.php.net/manual/en/book.errorfunc.php and setting your error reporting level https://www.php.net/manual/en/function.error-reporting.php

1 Comment

(the error i am referring to is php error. so that i can debug my php code easily)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.