Producing an Error
Explore how to create and handle errors in PHP with a focus on exceptions and environment-specific configurations. Understand the differences between development and production servers, and learn practical steps to improve error handling by generating test errors and configuring PHP settings appropriately.
We'll cover the following...
We'll cover the following...
Improving error handling
As soon as we started using a PHP server to serve .php scripts in Serving PHP Scripts, we had to worry about errors and showing them in the browser.
We mentioned back then that you need to make a distinction between the website as it is still running on your own computer and the website as it is running on a publicly accessible server. You may find that people talk about this distinction in different ways.
- When you’re working on your website on your own computer, you’re running it “locally”, or on your “development server”.
- When it runs on a publicly