# Enabling PHP opcode caching

> Turn on OPcache for your PHP version in cPanel so PHP pages load faster by reusing compiled code.

Source: https://helpcenter.ruachost.com/developers/php/enabling-php-opcode-caching/

**Opcode caching** improves PHP performance by storing precompiled script bytecode in memory. This allows PHP to serve pages faster without recompiling scripts on every request. On **ruachost.com**, you can enable opcode caching through cPanel.

## About APC and OPcache

- ### APC (Alternative PHP Cache)

  - Works with PHP 5.4 and earlier.
  - Requires installation as a separate extension.
- ### OPcache

  - Built into PHP 5.5 and later.
  - Drop‑in replacement for APC.
  - No separate installation required.

## Steps to Enable Opcode Caching

### Step 1: Log in to cPanel

- Access your hosting account at **ruachost.com**.
- Open **cPanel** from your dashboard.

### Step 2: Select PHP Version

1. In cPanel, go to **Software → Select PHP Version**.
2. If you don’t see this option, your server may not support it.

### Step 3: Enable the Extension

- For PHP 5.4 or older: check the box for **apc**.
- For PHP 5.5 or newer: check the box for **opcache**.
- Click **Save** to apply changes.

### Step 4: Verify

- Create a file named `info.php` in your site’s root directory:

  ```
  <?php phpinfo(); ?>
  ```
- Visit `http://yourdomain.com/info.php`.
- Look for the **APC** or **OPcache** section to confirm it is enabled.
- Delete the file afterward for security.

> **Note:**
- Some Ruachost accounts already have opcode caching enabled by default.
- OPcache is recommended for modern PHP versions.
- For more details, see the official OPcache manual.
