Firstly, I'm not sure whether this is possible and a Google search doesn't seem to provide much in the way of a solution. However ...
Is it possible to create a .html page which displays if the connection to the hosting server (apache/linux) is lost or the MYSQL service goes down?
So if either of the two situations should occur - then a page will be displayed as follows
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> *Sitename* - currently offline</title>
<meta name="description" content=" .. //">
<meta name="author" content=" .. //">
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>
<script src="js/scripts.js"></script>
<?php
// some PHP code
?>
<p> We're currently experiencing some technical difficulties with our site.
The issue should be fixed shortly - we apologise for any inconvenience caused.
Please try to access the site again later.
Thank you. </p>
</body>
</html>
The function would need to check the connection to the server when an attempt is made to access the site. If the connection is broken then display the above HTML.
Any help would be appreciated. Thanks
Is it possible to create a .html page which displays if the connection to the hosting server (apache/linux) is lost
Assuming you mean someone's network connection goes down half-way through surfing your site, as per some of the comments on the question, you could kind-of do some sort of solution in JavaScript but it's just a bad idea. You are implying that there's a problem with the server when there isn't. Let the browser do it's thing in this case, as it's more informative to the user and should present helpful hints to help them fix the actual problem.
If you mean the server has gone down entirely, you need some kind of solution like CloudFlare.
or the MYSQL service goes down?
Yes. For any response which might need the DB, if you have detected the DB going away, before you send any other HTTP headers do this;
header('HTTP/1.1 500 Internal Server Error');
echo 'Your error HTML.';
... or a "503 - Service unavailable"