Jump to content

How do I show the errors in the browser


ballhogjoni

Recommended Posts

Hmm well then in that case I think I'd write a php script that echos the last 10 lines of the error log onto a secured administration page somewhere so you don't have to keep going back and looking at the log, you can just refresh a page to view the error.

Link to comment
Share on other sites

Solve this the easy way. Add the following two lines to your script -

 

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

 

This will show everything but fatal parse errors.

 

If you are getting fatal parse errors, they will show up in the web server log file. However, if you are just writing code and it has fatal parse errors, you should be debugging it on a local development computer and not a live server. Your code should be error free before you put it onto a live server.

Link to comment
Share on other sites

Solve this the easy way. Add the following two lines to your script -

 

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

 

This will show everything but fatal parse errors.

 

If you are getting fatal parse errors, they will show up in the web server log file. However, if you are just writing code and it has fatal parse errors, you should be debugging it on a local development computer and not a live server. Your code should be error free before you put it onto a live server.

 

Yeup we already discussed this, we're displaying fatal errors :)

Link to comment
Share on other sites

From the posted information, no one knows for a fact what type of errors are occurring.

 

Turning on full php error_reporting and display_errors in a .htaccess file (when php is running as an Apache server module) or in a local php.ini (when php is running as a CGI wrapper) will help more directly with debugging.

 

Code that is experiencing a problem serious enough there there is no output from it is not ready to be put onto a live server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.