[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

PHP error outputing

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?
1 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.
isilver18Author Commented:
You are a true champ.  Thank you very much for this fix.  

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now