How to set php.ini so undeclared variables break a page

I am currently running a PHP on Windows, but when I post my web pages to the live site, they are running on a Linux box.

The problem: When I code my php to make use of an undeclared variable (such as $sSelectedFilterProvince below), my local environment runs it just fine (even though it's obviously a bug because I did not declare $sSelectedFilterProvince earlier and set it to a value).
But in the live environment the code below just times out the page after about 2 minutes with a cryptic message.

What I would like to do is to set my php.ini file setting so that I encounter that same hang problem on my local environment before I post the code to the live site. I am assuming there's some type of setting that I can set to make this happen, but in looking at the various setting options in my local copy of php I don't see any particular setting that might be the one.

Any clues as to how I might recreate this environment on my local system?

Many thanks!

if ($sSelectedFilterProvince=="Alberta") 
{
    ... do something...
}

Open in new window

LVL 1
rascalAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
Set "error_reporting" to 'E_ALL'.
// Report all PHP errors (see changelog)
error_reporting(E_ALL);

Open in new window


http://php.net/manual/en/function.error-reporting.php

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
Also, see if you can use the same version of PHP as your live site.
rascalAuthor Commented:
Thanks Dave,
That worked - it showed me a bunch of just regular inconsequential notices, but it did also highlight the missing variable definition!
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Dave BaldwinFixer of ProblemsCommented:
You're welcome.  I use that even in production because I need the code to work and I need to know if something doesn't work.
rascalAuthor Commented:
But doesn't that flood the screen with a bunch of inconsequential notices? It does on my screen. Even with that particular problem fixed.
Ray PaseurCommented:
flood the screen...
Not necessarily.  You can use these settings to suppress the messages and still keep the log:

ini_set('display_errors', FALSE);
ini_set('log_errors', TRUE);
Dave BaldwinFixer of ProblemsCommented:
But doesn't that flood the screen with a bunch of inconsequential notices? It does on my screen.
Not on my sites.  I fix even the 'inconsequential notices' so they won't show up as errors later.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.