# Accessing Your Website Error Logs

Source: https://support.kapsulehost.com/en-us/error-logs

Error logs record problems that occur on your website, including PHP errors, failed database connections, and plugin issues. When something goes wrong on your site, the error log is often the fastest way to identify the cause.

### Accessing Logs via File Manager or SFTP

KPanel does not have a dedicated Logs tab. Log files are stored on the server and can be accessed via the File Manager or SFTP.

**Using the [File Manager](https://support.kapsulehost.com/en-us/file-manager):**

1. Log in to KPanel at [kpanel.kapsulehost.com](https://kpanel.kapsulehost.com)
2. Go to **Websites** and select the affected site
3. Click **Settings → File Manager**
4. Navigate to the `logs/` directory in your site root

**Using [SFTP](https://support.kapsulehost.com/en-us/sftp-access):**

1. Go to **Settings → SFTP** in KPanel for your site's connection details
2. Connect with FileZilla or your preferred SFTP client
3. Navigate to the `logs/` directory in your site root

The `logs/` directory contains:

- **PHP error log**, errors generated by PHP code (the most commonly needed log)
- **Access log**, a record of all HTTP requests to your site
- **Error log**, server-level errors (500, 502, etc.)

### Reading a PHP Error Log

A typical PHP error log entry looks like:

```
[03-Jun-2026 14:32:11 UTC] PHP Fatal error: Call to undefined function get_header() in /var/www/sites/yourdomain/public_html/wp-content/themes/mytheme/page.php on line 8
```

This tells you the **date and time**, the **error type**, a **description** of the problem, and the **file path and line number** where the error occurred.

### Common Error Types

| Type | Severity | What It Means |
|------|----------|---------------|
| Fatal error | High | Execution stopped. Page will not load. |
| Warning | Medium | Something unexpected happened but execution continued. |
| Notice | Low | Minor issue, usually a coding best practice violation. |
| Deprecated | Low | A function being used will be removed in a future PHP version. |

### Enabling WordPress Debug Mode

For WordPress sites, enabling debug mode outputs more detailed error information:

1. Connect via SFTP or use the File Manager in KPanel
2. Open `wp-config.php` in the WordPress root
3. Add or update these lines:

```php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
```

Errors will be written to `wp-content/debug.log` rather than displayed on-screen.

> **Warning:** Do not leave `WP_DEBUG_DISPLAY` set to `true` on a live site, as this can expose sensitive information to visitors.

> **Tip:** Check error logs immediately after [updating WordPress, plugins, or themes](https://support.kapsulehost.com/en-us/wordpress-updates). Many post-update issues leave clear traces in the PHP error log.
