Building Custom PHP Error Handling
#PHP #ApacheHTTPD #ErrorHandling
Full steps can be found at https://i12bretro.github.io/tutorials/0048.html
01. Navigate to PHP install directory in Explorer
02. Edit php.ini in a text editor
03. Find ;auto_prepend_file
04. Uncomment the line by removing the ;
05. 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
auto_prepend_file = "C:\xampp\htdocs\library\global_header.php";
- There is also an auto_append_file setting to add the include after every .php page the server loads
07. Save
08. Navigate to Apache install directory/htdocs in Explorer
09. Create a library directory
10. Download custom_php_errors.zip https://drive.google.com/open?id=1RGBcRU3m2-qgM9yeFAFMZmC21OGH8yrE
11. Extract the contents of custom_php_errors.zip to the library directory
/library/global_header.php
/library/images/bottom.gif
/library/images/error_bg.jpg
/library/images/mainbg.gif
/library/images/top.gif
12. Restart the Apache service
13. Create a .php page with intentional errors to invoke the new error page
14. Launch a browser and navigate to the test .php page
### Connect with me and others ###
★ Discord: https://discord.com/invite/EzenvmSHW8
★ Reddit: https://reddit.com/r/i12bretro
★ Twitter: https://twitter.com/i12bretro