Simple Errors v. 0.1
Quick jump:
This guide will help you install, configure, and optimize Simple Errors.
Thank-you for downloading Simple Errors. Simple Errors simple overrides the default Apache Error pages with your own, customized version.
Please note: this script is under the GNU GPL license. So, while it is free, the "powered by Simple Errors v. x.xx by kneuf!" must remain at the bottom of every page.
Requirements
The exact requirements are unknown, as this is a beta.
But the basics include:
- Apache Server
- PHP (tested with 4.2.x)
- Ability to edit and write files
- Access to .htacces file
- Ability to upload and store these files somewhere
Make sure that when you got this, that these files are all present:
- config.inc.php, the configuration file
- errors.php, the error parser file
- error_type.log, the file with the error codes and description and such
- .htaccess, the file that restricts URL access (the scripts can still access them) to the .txt and .log files.
- error_log.log, the file that logs all the errors
- footer.txt, the footer file.
- header.txt, the header file.
- gpl.txt, the GNU license file.
- readme.htm, this file.
- If you don't already have it, download it! Go to kneuf.com to do so.
-
Open config.inc.php and edit the following:
- $log_on_error = 1; Set to 1 if you want to save the errors to a file, 0 if not. Note: you must fill out the $error_file variable. Default is 1.
- $email_on_error = 0; Set to 1 if you want the script to email a report when an error occurs, 0 if not. Note: you must be able to send out mail from your server and fill in the
following variables. Default is 1.
- $show_errors = 0; 1 = show debugging info, 0 = don't show debug info. Default is 0
- $show_header = 0; 1 = show header (specify file above, 0 = don't display header. Default is 0
- $show_footer = 0; 1 = show footer (specify file above, 0 = don't display footer. Default is 0
- $main_site = "http://www.kneuf.com"; Your home page URL.
- $log_file = "/full/system/path/to/error_type.log"; The absolute server path to the errors file (that contains the error codes and text, etc).
- $error_file = "/full/system/path/to/error_log.log"; The absolute server path to the errors log file (that contains the log and when each error occurred).
- $header = "/full/system/path/to/header.txt"; If $show_header is set to 1, specify the absolute server path to the header file location here.
- $footer = "/full/system/path/to/footer.txt"; If $show_footer is set to 1, specify the absolute server path to the footer file location here.
- $to = ""; Fill in the email address you want the report sent to.
- Open errors.php and edit the first line that says
include("/full/system/path/to/config.inc.php"); and fill in the full system path to the config.inc.php file.
- Open the(or create, remember that the file name is .htaccess!) .htaccess file in the directory that you want to have Simple Errors monitor (NOT
the one that came with Simple Errors!). Note: Any directory that above this will also be monitored. E.x., say you put it in your root directory, say, /, and there is another directory
above that, /test/, then that directory will also be monitored.
-
- Remember to back-up the .htaccess file before making any changes to it!
- Add the following lines:
Note: If you install this script in a directory other than /errors/, then change /errors/ to the directory you are going to be installing this script in.
- Save all files, and upload only the .htaccess file we just modified.
- Edit header.txt, or footer.txt if you want.
- Edit the HTML in the errors.php file if you wish, and upload all files. Recommended install directory is /errors/.
- CHMOD error_log.log to 755, so it can be written to.
You can optimize Simple Errors in a variety of ways. Perhaps the most important one is the error_type.log file. You can add news error codes and information to it easily. But make
sure you add a new line to the .htaccess file that has all the ErrorDocument stuff in it.
Example, add a new error code: 999, "Just Made This Up"
-
Open up error_type.log and have a look at it. Its format is:
ErrorCode|Title|SubTitle|ErrorText
- ErrorCode is the code of the error. So, in our example, it would be 999.
- Title is the title for the document. So, in our example, it would be 999 - Just Made This Up.
- SubTitle is the sub-heading for the document. So, in our example, it would be Just Made This Up.
- ErrorText is the text for the document, to better explain the error. So, in our example, it would be This error means that I was lazy and couldn't figure out a better
example..
-
So, the new line that we will be adding is:
999|999 - Just Made This Up|Just Made This Up|This error means that I was lazy and couldn't figure out a better example.
-
Don't forget to add this line to the .htaccess file with all the ErrorDocument stuff in it:
ErrorDocument 999 /errors/errors.php?999
- Re-upload and presto! You should now have a new error for the script to handle.
When you upload the files, and put them in a directory called /error/ (recommended), here is what is should look like:
- Document Root (e.x., URL is http://www.site.com)
-
- .htaccess (file)
- error (directory)
- .htaccess (file)
- errors.php (file)
- config.inc.php (file)
- error_type.log (file)
- error_log.log (file)
- footer.txt (file)
- header.txt (file)
To contact kneuf!, visit www.kneuf.com.
To visit the GNU website, www.gnu.org.
To visit the GNU GPL license website, www.gnu.org/licenses/licenses.html#GPL.
View the GPL license (local), gpl.txt.
Hope this help file helps in a way. A remember: Simple Errors is under the GNU GPL license!
That is all to this help file.
PS: If .htaccess file doesn't work for you, make sure that you have it enabled (ask your system operator) or if it is used with a different filename, use that instead.
Powered by Simple Errors by kneuf!