Jump to content

Recommended Posts

Hi Guys

 

Bit of an odd one. I've created a custom 500 error page and my hosting company has told me that they've made the necessary httpd.conf changes.

 

The thing is - how do you simulate a 500 server errror?

 

I've tried throwing an exception but this did nothing. I've also tried breaking a htaccess file but this doesnt display my custom page, which leads me to think that the configuration hasn't been setup properly. But as I'm not sure if this is a valid way to test it I thought I would get some advice.

 

Any helo would be appreciated!

 

Drongo

Link to comment
https://forums.phpfreaks.com/topic/279133-simulate-500-server-error/
Share on other sites

You may be able to put random nonsense in your .htaccess, and after the ErrorDocument if you had to add one in there. Or definitely in the .htaccess of a subdirectory.

 

FYI PHP only triggers 500s in certain installations.

  • 2 weeks later...

Try something like:

<?php

require_once('/made/up/page/that/does/not/exist.foo.bar');

?>

If it is a 500 error you want then, provided your service provider has configured the server correctly for a production environment, requiring a non-existent page will throw a fatal (500) error.

  • 5 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.