Development / Production Environments...

So to get started with a development environment, people usually get XAMPP, LAMP, WAMP, MAMP, or something like that. Say you’ve done that and like the website, have well-designed tables for the database and all that good stuff. Now you want to put it up for real. You find a hosting service that offers features you want… say iPage. I need to somehow change things so that errors are no longer displayed, so that’s one change I need to make.

Are there other things to change before taking the site public?
Is it easy to put your database on the inexpensive hosting sites?

taken from php.net

<?php

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings …)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (see changelog)
error_reporting(E_ALL);

// Report all PHP errors
error_reporting(-1);

// Same as error_reporting(E_ALL);
ini_set(‘error_reporting’, E_ALL);

?>

I wouldn’t recommend completely disabling all errors, since you wouldn’t know if something went wrong during an update or a host upgrade. Just put @ before the function call ($qry = @mysql_query())

Sponsor our Newsletter | Privacy Policy | Terms of Service