Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Any way to enable "display_errors" (PHP) on a page-by-page basis?

LEGEND ,
Dec 18, 2007 Dec 18, 2007

Copy link to clipboard

Copied

I have just discovered that my host sets 'display_errors' OFF by default. I
have asked them not to do this, but in the meantime, is there any way I can
enable this on the specific page?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


TOPICS
Server side applications

Views

329
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 18, 2007 Dec 18, 2007

Copy link to clipboard

Copied

Murray *ACE* wrote:
> I have just discovered that my host sets 'display_errors' OFF by
> default. I have asked them not to do this, but in the meantime, is
> there any way I can enable this on the specific page?

A live production site should never have display_errors turned on. It
gives malicious attackers valuable information about your server structure.

It's very easy to turn on the display of errors to debug a particular
script. Just add this at the very top of the page:

<?php ini_set('display_errors', '1'); ?>

It must come before anything else.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 18, 2007 Dec 18, 2007

Copy link to clipboard

Copied

Thanks, David.

I'll have to adjust my thinking! 8(

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"David Powers" <david@example.com> wrote in message
news:fk8mov$283$2@forums.macromedia.com...
> Murray *ACE* wrote:
>> I have just discovered that my host sets 'display_errors' OFF by default.
>> I have asked them not to do this, but in the meantime, is there any way I
>> can enable this on the specific page?
>
> A live production site should never have display_errors turned on. It
> gives malicious attackers valuable information about your server
> structure.
>
> It's very easy to turn on the display of errors to debug a particular
> script. Just add this at the very top of the page:
>
> <?php ini_set('display_errors', '1'); ?>
>
> It must come before anything else.
>
> --
> David Powers, Adobe Community Expert
> Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
> Author, "PHP Solutions" (friends of ED)
> http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 18, 2007 Dec 18, 2007

Copy link to clipboard

Copied

Murray *ACE* wrote:
> Thanks, David.
>
> I'll have to adjust my thinking! 8(
>

How about adjusting it this way: take code that David suggests, wrap it with an if statement that checks for you or a specified group of users being logged into the site, then you get the error reports, but no one that isn't authorized does.

--
Danilo Celic
| Extending Knowledge Daily : http://CommunityMX.com/
| Adobe Community Expert

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 18, 2007 Dec 18, 2007

Copy link to clipboard

Copied

LATEST
.oO(danilocelic AdobeCommunityExpert)

>How about adjusting it this way: take code that David suggests, wrap it
>with an if statement that checks for you or a specified group of users
>being logged into the site, then you get the error reports, but no one
>that isn't authorized does.

The better idea on a live site is to write errors to a logfile. With
debug_backtrace() or your own error/exception handler it's even possible
to get a nice backtrace to where the error occured and which function
calls led to it.

Micha

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines