> For the complete documentation index, see [llms.txt](https://docs.mindstellar.com/osclass-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mindstellar.com/osclass-docs/developers/basic-osclass/debug-php-errors.md).

# Debug PHP Errors

The **`OSC_DEBUG`** constant, added in version 2.3, controls the display of php errors and warnings. If this setting is not defined in config.php, the default value is false.

When the **`OSC_DEBUG`** is false, the error reporting level is `E_ALL ^ E_NOTICE ^ E_USER_NOTICE`. In that case, we're not showing notice and strict php errors. However, if we set the constant to true, the error reporting level is `E_ALL | E_STRICT` and `display_error` value is **1**.

The **`OSC_DEBUG_LOG`** constant, added in version 2.3, logs these errors to a file called debug.log in oc-content. If Apache doesn't have write permissions, you may need to create the file first and set the appropriate permissions (i.e. use 666).

```php
/**
 * Copy this code to config.php file
 * This will disable notice and strict errors
 */
define('OSC_DEBUG', false) ;
```

```php
/**
 * Copy this code to config.php file
 * This will show all error notices and warnings on the site
 */
define('OSC_DEBUG', true) ;
```

```php
/**
 * Copy this code to config.php file
 * This will log all error notices and warnings to a file called debug.log in oc-content
 */
define('OSC_DEBUG', true) ;
define('OSC_DEBUG_LOG', true) ;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mindstellar.com/osclass-docs/developers/basic-osclass/debug-php-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
