Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 25th, 2006, 09:53 AM
Registered User
 
Join Date: Feb 2006
Location: , , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH9 - Apache not using custom error page

Hi all,

I have followed the instructions in the book and edited the httpd.conf file and restarted apache, and have created the custom error page error.php and saved it in the appropriate folder but when I hit an error page within the localhost (for example the page not found error when I go to http://localhost/index.php) I am still seeing the standard internet explorer 'page not found' rather then the error.php page.

Can anyone help me figure out what I've missed?

I have changed the httpd.conf file so that it reads:

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
ErrorDocument 400 /error.php?400
ErrorDocument 401 /error.php?401
ErrorDocument 403 /error.php?403
ErrorDocument 404 /error.php?404
ErrorDocument 500 /error.php?500

Any help would be appreciated.

Thanks, Dan
Reply With Quote
  #2 (permalink)  
Old March 13th, 2006, 02:10 PM
Authorized User
 
Join Date: Mar 2006
Location: , , United Kingdom.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can tell you that Apache is using the error instructions you have set in httpd.comf file, but the reason why your custom error messages aren't working is because IE has a setting called "Show friendly HTTP error messages" enabled. This is what is stopping your custom error messages appearing.

To disable this setting simply open IE and go to Tools -> Options -> Advanced Tab and scroll down the Settings list untill you come to "Show friendly HTTP error messages" now just detick the tickbox next to it. Now just click Ok! Your custom error messages should now be showing.

Hope this helps.

Reply With Quote
  #3 (permalink)  
Old June 17th, 2006, 05:24 AM
Registered User
 
Join Date: Feb 2006
Location: , , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - that works. Does that mean that in a live environment users will only see custom error messages if they have "Show friendly HTTP error messages" turned off in their browser? That seems to be a very unreliable way to ensure that users see custom error messages.
Reply With Quote
  #4 (permalink)  
Old June 20th, 2006, 11:25 AM
Authorized User
 
Join Date: Mar 2006
Location: , , United Kingdom.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No this setting one effects localhost. If your site was live it will show the error message you define.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
got error in apache while designing a page... thomaskelly HTML Code Clinic 1 May 26th, 2008 10:51 AM
Error in Monthly Calendar Report (Ch9) mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 6 May 7th, 2008 11:43 PM
How to provide custom error page for 401 Errors naganirangen Apache Tomcat 3 February 9th, 2008 01:54 PM
Data Access Page on Apache Teqlump Access 0 February 28th, 2005 05:22 PM
custom error page texasraven Classic ASP Basics 0 May 13th, 2004 04:47 PM



All times are GMT -4. The time now is 02:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.