How can I test my 500 error page works I had a problem with my cloud server and all my sites were generating 500 errors. The response page the visitor saw varied between Craft 2, Craft 3 and ExpressionEngine 2 sites.
The Craft 3 ones showed:


  CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]:
  General error: 1 Can't create/write to file '/tmp/#sql3fa0.MYI'
  (Errcode: 28)


Some showed what I think is the generic cPanel page:


  Internal Server Error
  
  The server encountered an internal error or misconfiguration and was
  unable to complete your request.
  
  Please contact the server administrator at webmaster@scottish6days.com
  to inform them of the time this error occurred, and the actions you
  performed just before this error.
  
  More information about this error may be available in the server error
  log.
  
  Additionally, a 500 Internal Server Error error was encountered while
  trying to use an ErrorDocument to handle the request.


Others a blank page.

I now want to have a nice/useful/descriptive 500 error page shown if it happens again.
So after reading up on this, in particular, the  NY Studio 107 article on error pages I want to be able to test if my new 500 error page does get shown when there is a real 500 error situation.

The hosting company suggested adding a 500.html file in the public_html, adding ErrorDocument 500 /500.html to my .htaccess and creating a script file with this in it:

&lt;?php
ini_set('display_errors', 0);
throw new Exception('Test');
?&gt;


and calling it in the browser, but it didn't work. Their response was:


  Sorry, in this case the HTTP 500 error is not caught by Apache in a
  way it can handle it. There are ways of doing PHP error handling in
  PHP, but it will depend on the application to do it for you.


Any suggestions as to how to test that it's all working properly?
Any chance you're out of disk space? That error shows that it can't create a file in /tmp which means either the permissions on /tmp are wrong, or potentially you're out of disk space.

c.f.: https://stackoverflow.com/questions/11997012/mysql-cant-create-write-to-file-tmp-sql-3c6-0-myi-errcode-2-what-does

As for the error page, if you just want to view the page, you can navigate to it directly... if you want to force a 500 error to happen, just change the db password in your .env to something that doesn't work.