---
title: PHP APCu
description: Monitor PHP APCu in-memory data caching.
breadcrumbs: Docs > Integrations > PHP APCu
---

# PHP APCu
Supported OS 
## Overview{% #overview %}

This check monitors [PHP APCu](https://www.php.net/manual/en/book.apcu.php) through the Datadog Agent.

## Setup{% #setup %}

The PHP APCu check is not included in the [Datadog Agent](https://app.datadoghq.com/account/settings/agent/latest) package, so you need to install it.

### Installation{% #installation %}

For Agent v7.21+ / v6.21+, follow the instructions below to install the PHP APCu check on your host. See [Use Community Integrations](https://docs.datadoghq.com/agent/guide/use-community-integrations/) to install with the Docker Agent or earlier versions of the Agent.

1. Run the following command to install the Agent integration:

   ```shell
   datadog-agent integration install -t datadog-php_apcu==<INTEGRATION_VERSION>
   ```

1. Configure your integration similar to core [integrations](https://docs.datadoghq.com/getting_started/integrations/).

#### APCu{% #apcu %}

APCu does not expose metrics by default so this integration includes a metric exporter, located here:

```gdscript3
/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_apcu/assets/exporter/apcu-dd-handler.php
```

When you configure your Agent, refer to the exporter directly by this file name, or configure an alias for it on your web server. For example, if you're using Apache, the alias in the web server configuration file would look like this:

```gdscript3
Alias /apcu-status /opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_apcu/assets/exporter/apcu-dd-handler.php
<Location /apcu-status>
    Require all denied
    Require local
</Location>
```

### Configuration{% #configuration %}

1. Edit the `php_apcu.d/conf.yaml` file, in the `conf.d/` folder at the root of your Agent's configuration directory to start collecting your `php_apcu` performance data. See the [sample `php_apcu.d/conf.yaml` file](https://github.com/DataDog/integrations-extras/blob/master/php_apcu/datadog_checks/php_apcu/data/conf.yaml.example) for all available configuration options.

   ```
   instances
     - url: http://localhost/apcu-status
   ```

1. [Restart the Agent](https://docs.datadoghq.com/agent/guide/agent-commands/#start-stop-and-restart-the-agent).

### Validation{% #validation %}

Run the [Agent's status subcommand](https://docs.datadoghq.com/agent/guide/agent-commands/#agent-status-and-information) and look for `php_apcu` under the Checks section.

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **php\_apcu.cache.mem\_size**(gauge)     | used memory size*Shown as byte*             |
| **php\_apcu.cache.num\_slots**(gauge)    | number of cache slots*Shown as unit*        |
| **php\_apcu.cache.ttl**(gauge)           | default ttl*Shown as second*                |
| **php\_apcu.cache.num\_hits**(gauge)     | cache hit count*Shown as hit*               |
| **php\_apcu.cache.num\_misses**(gauge)   | cache miss count*Shown as miss*             |
| **php\_apcu.cache.num\_inserts**(gauge)  | cache insert count*Shown as set*            |
| **php\_apcu.cache.num\_entries**(gauge)  | number of cache entries*Shown as item*      |
| **php\_apcu.cache.num\_expunges**(gauge) | number of cache expunges*Shown as eviction* |
| **php\_apcu.cache.uptime**(gauge)        | uptime*Shown as second*                     |
| **php\_apcu.sma.avail\_mem**(gauge)      | available memory size*Shown as byte*        |
| **php\_apcu.sma.seg\_size**(gauge)       | total memory size*Shown as byte*            |
| **php\_apcu.sma.num\_seg**(gauge)        | number of cache segments*Shown as unit*     |

### Events{% #events %}

The PHP APCu integration does not include any events.

### Service Checks{% #service-checks %}

**php\_apcu.can\_connect**

Returns `CRITICAL` if the Agent is unable to connect to and collect metrics from the monitored APCu instance. Returns `OK` otherwise.

*Statuses: ok, critical*

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
