display_errors in a single script only

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PHPNoobee
Forum Newbie
Posts: 2
Joined: Thu Sep 02, 2010 10:49 am

display_errors in a single script only

Post by PHPNoobee »

I have a script that runs locally, but does not run through on the live server.

I'd like to add this to the top of the script:

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

but I don't want to change these setting site-wide... only for this one script. Will this code affect this single page only?

(sorry for the newbie question, and I apologize ahead of time if the answer has already been posted somewhere on this forum... I did try a search but couldn't find an answer to this specific question)

any help would be greatly appreciated
User avatar
bradbury
Forum Commoner
Posts: 40
Joined: Wed Aug 25, 2010 11:21 am
Location: Eugene, OR

Re: display_errors in a single script only

Post by bradbury »

php scripts run through the server no matter what. why are you trying to get an error report locally?
PHPNoobee
Forum Newbie
Posts: 2
Joined: Thu Sep 02, 2010 10:49 am

Re: display_errors in a single script only

Post by PHPNoobee »

bradbury wrote:php scripts run through the server no matter what. why are you trying to get an error report locally?

no ... actually, I'm not trying to run it locally... it works fine locally... it's crapping out on the live server, so I wanted to display errors on this particular page to try to trouble shoot live... but i don't want the error reporting to be for ALL pages... just wanted to ensure that this wouldn't change anything in the php.ini file... I don't think it would, but wanted to be sure
Post Reply