PHP error outputing

Posted on 2007-07-20
Last Modified: 2008-01-09
I have my home server that runs on Windows 2003 with PHP version 4.4.7.  At work it runs on a Linux with PHP version 4.3.11.

The way it works is that I create the PHP files at home and move them over to the server at work.  It works perfectly at home.  When I move it over it stops working.  I think the biggest problem is that error dispaying is turned off at work.  So I have no idea what the error is.  

I have tried to install PHP 4.3.11 on Windows 2003 however I can't get it to work.  I haven't found a version that works on Windows 2003.  So I need to figure out the errors that are occuring at work to fix them.  I can't touch the work servers at all.  

Is their some way I can do my own error checking.  Can I tell PHP to output the errors within these scripts?
Question by:isilver18
    LVL 16

    Accepted Solution

    At the top of your script, put:

    ini_set('display_errors','1'); // turns on display errors
    ini_set('error_reporting',E_ALL ^ E_NOTICE); // displays all errors except for 'notice' messages

    This will turn on the error reporting features for this script only. If you want to apply it to your entire web directory, place the following two lines in a file called ".htaccess" on your server at work, in your web-root directory:

    php_value display_errors 1
    php_value error_reporting 6135

    This is the equivalent of the first suggestion, but you don't have to add it to every script, it automatically applies to every PHP script in the same directory, and sub-directories of the .htaccess file's location.

    Author Comment

    You are a true champ.  Thank you very much for this fix.  

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now