Jump to content
KL21

Where Are Php Error Messages?

Recommended Posts

I'm writing PHP scripts, uploading them to the TCH server and then executing them online. When I have any sort of PHP error my browser displays a totally blank page, no error messages. Where can I find the PHP error messages? I've tried my error logs and also looking at the source for the web page. But there's nothing there. Any suggestions? Hopefully this is an easy question. Thanks!

Share this post


Link to post
Share on other sites

Add the following commands to your .htaccess file in the folder containing the php script (or create an .htaccess file if none exists.)

 

php_flag display_errors on

php_value error_reporting 7

Share this post


Link to post
Share on other sites

Welcome to the forums, KL21.

 

Another way to get the error messages to display in the resulting page is to use the error_reporting() function.

Share this post


Link to post
Share on other sites

Welcome to the forums! See how helpful the family is here? I even learned something on this one!

Share this post


Link to post
Share on other sites

Welcome to the forums and your new home, KL21!

Share this post


Link to post
Share on other sites
Add the following commands to your .htaccess file in the folder containing the php script (or create an .htaccess file if none exists.)

 

php_flag display_errors on

php_value error_reporting 7

 

Why is it that error_reporting(E_ALL) doesn't report all errors, yet using that .htaccess file does?

Share this post


Link to post
Share on other sites

I'm just guessing here, but I think that if the error reporting level is set in your script, and the script has severe errors in it that prevent the script from running, PHP never gets to execute your error_reporting() function so it can tell you what's wrong.

 

When the error reporting level set in the .htaccess file, PHP reads the .htaccess file first before looking at your script and will set the error reporting level even if the PHP script is complete jibberish. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...