Shopping Cart Error Handler Documentation
Thank you for choosing MagneticOne!
This manual should help you install the software on your site within a few minutes. If you experience any problems, please consult the documentation at http://support.magneticone.com/. And, please don't hesitate to contact us - we're always glad to help.
Product Overview
Error Handler requires basic technical skills to setup - code editing, please contact technical person to set it up if you aren't sure in your skills.
Installation Instructions
1. Before you begin
- Backup all shopping cart files to your server or local computer.
Backup your database.
Copy error_handler.php from public_html folder of product archive into your store web root folder (where primary index.php is located)
2. Installation for osCommerce, Zen Cart, CRE Loaded
- In your Shopping cart, open the file includes/application_top.php.
Edit the open file as stated below to include error handler :
Find these lines:
// set the level of error reporting
error_reporting(E_ALL & ~E_NOTICE);
Insert this line AFTER previous lines:
require_once('error_handler.php');
- Save and close the file.
2. Installation for X-Cart
- X-Cart has one exception - it includes lots of non-existing files.
- See option XCART_ENABLE_WARNINGS to enable those warnings (they are disabled by default).
- In your Shopping cart, open the file auth.php.
In the open file find the following line:
include_once $xcart_dir."/init.php";
- Right after it insert this code:
require_once('error_handler.php');
- Save and close the file
3. Installation for other PHP applications
Installation should be very similar to installation instructions for osCommerce, Zen Cart, CRE Loaded, with exception of file names.
Just include Error Handler as close to application's start as possible in order to catch most errors.
4. Complete the installation
- Edit error_handler.php: enter your email to send error report emails.
- Create errors.txt file in web root folder with write permissions (chmod +777)
- Create errors_stamp.txt file in web root folder with write permissions (chmod +777)
Post-Install Configuration
You need to secure the log file itself by adding this final line of code to your .htaccess file:
# prevent access to PHP error log
<Files errors.txt>
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files errors_stamp.txt>
Order allow,deny
Deny from all
Satisfy All
</Files>
How to Test
- We recommend using PHP function trigger_error.
trigger_error — Generates a user-level error/warning/notice message - Just insert following code inside any php file to generate user error.
trigger_error("User error to test error handler", E_USER_ERROR);
If you experience any technical issues during installation, we recommend using the Shopping Cart Diagnostic Utility (m1info.php) already included in your installation package. This utility helps solve most initial configuration problems (e.g. hosting configuration, php/mysql configuration, web server configuration, or shopping cart configuration).
Upgrade Instructions
- Download the latest version of the software from MagneticOne Store. (You can find the download link on Order Info page of your Account section.)
- Re-upload files from the package to your store. Overwrite existing files if necessary.
- Check the upgrade.txt file in the installation archive for additional upgrade instructions (if any).
Un-installation Instructions
Restore all the shopping cart files from backup. (If you didn’t make a backup, please follow the above installation instructions in reverse order.)
Delete all files that were copied from the installation package.
!Important: If you have other MagneticOne modules installed, DO NOT delete includes/m1_common_functions.php.
Related Resources
Thank you for reading this far. Good luck with your e-business!
Yours,
MagneticOne Team
http://support.magneticone.com
