0048.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Building Custom PHP Error Handling</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Web Server,Apache Httpd,Apache,Web Developer,System Administrator,System Monitoring,PHP,Error Handling,Fun With Code,Windows,Web Server Customization,Web Server Administration,Web Based,System Administration,Self-hosted,PHP Application,Microsoft Windows,Install Guide,Home Lab,HTTPD,Free Software,Development,Developer,Custom Error Page,Custom Error,PHP Custom Error Pages,PHP Configuration,PHP Error Handling,Apache HTTPD,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Building Custom PHP Error Handling">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="03/26/2022 01:04:45 PM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Building Custom PHP Error Handling</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <ol>
  26. <li>Navigate to PHP install directory in Explorer</li>
  27. <li>Edit php.ini in a text editor</li>
  28. <li>Find ;auto_prepend_file</li>
  29. <li>Uncomment the line by removing the ;</li>
  30. <li>Setting the value of auto_prepend_file to the full path of a PHP file will include the file automatically before every .php page the server loads
  31. <p>auto_prepend_file = &quot;C:\xampp\htdocs\library\global_header.php&quot;;</p>
  32. <ul>
  33. <li>There is also an auto_append_file setting to add the include after every .php page the server loads</li>
  34. </ul>
  35. </li>
  36. <li>Save</li>
  37. <li>Navigate to Apache install directory/htdocs in Explorer</li>
  38. <li>Create a library directory</li>
  39. <li>Download custom_php_errors.zip <a href="https://drive.google.com/open?id=1RGBcRU3m2-qgM9yeFAFMZmC21OGH8yrE" target="_blank">Download</a></li>
  40. <li>Extract the contents of&nbsp;custom_php_errors.zip to the library directory
  41. <p>/library/global_header.php<br />
  42. /library/images/bottom.gif<br />
  43. /library/images/error_bg.jpg<br />
  44. /library/images/mainbg.gif<br />
  45. /library/images/top.gif</p>
  46. </li>
  47. <li>Restart the Apache service</li>
  48. <li>Create a .php page with intentional errors to invoke the new error page</li>
  49. <li>Launch a browser and navigate to the test .php page</li>
  50. </ol>
  51. </div>
  52. </div>
  53. </body>
  54. </html>