Jump to content

simulate 500 server error


Drongo_III

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

  • 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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.