# Debugging & problem solving

## Introduction

Your code should not produce any PHP warnings or notices during normal usage. This primarily implies that all variables must be defined before being used. It also implies that a corrupted installation may produce errors, although as far as practicable the code should accommodate this.&#x20;

{% hint style="warning" %}
By default, all PHP errors, warnings and notices are suppressed and not visible to the public. You can use debugging to show them.&#x20;
{% endhint %}

{% hint style="info" %}
A blank page or a page that has not been fully loaded, usually indicates a PHP fatal error. Server logs (such as Apache Error Logs) often also provide useful information.&#x20;
{% endhint %}

## Browser addon

We recommend this collection of :point\_right: [Firefox Addons](https://addons.mozilla.org/en-US/firefox/collections/camer0n/e107developer/). The most important being the `e107 Debugger`. If you don't wish to use the debugger, you can still activate various [debugging modes](#debug-modes) manually, by changing the query string of the URL and adding the debug mode. For example: directly after `.php` add `?[debug=xxxx]`

*Example:* `yourwebsite.com/news.php?[debug=basic!]`

## Debug modes

| Query                | Description                                 |
| -------------------- | ------------------------------------------- |
| \[debug=basic!]      | Display basic error information             |
| \[debug=traffic!]    | Display traffic information                 |
| \[debug=showsql!]    | Display basic SQL queries                   |
| \[debug=time!]       | Display load/processing times               |
| \[debug=notice!]     | Display PHP Notices                         |
| \[debug=warn!]       | Display PHP Warnings                        |
| \[debug=backtrace!]  | Display PHP Backtraces                      |
| \[debug=deprecated!] | Display deprecated method or function calls |
| \[debug=inc!]        | Display included files                      |
| \[debug=paths!]      | Display paths and variables                 |
| \[debug=bbsc!]       | Display BBCodes and Shortcodes              |
| \[debug=sc!]         | Display Shortcode placement                 |
| \[debug=sql!]        | Display detailed SQL analysis               |
| \[debug=everything!] | Display all debugging details               |
| \[debug=off!]        | Disable debugging                           |

{% hint style="info" %}
As of e107 v2.3.1 - the `+` sign has been changed to an exclamation mark `!`. \
For example: `[debug=basic!]` instead of `[debug=basic+]`
{% endhint %}
