---
title: Transactions named /index.php or /unknown
source: https://docs.newrelic.com/docs/apm/agents/php-agent/troubleshooting/transactions-named-indexphp-or-unknown
---

## Problem

The PHP agent collects metric data, but all of your transactions are named `/index.php` or `/unknown`.

## Solution

If the agent is not detecting your framework for some transactions, you can use our [API](https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-name-wt) to name your transactions. The `newrelic_name_transaction` [API function](https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_name_transaction/) can be used wherever a custom transaction name is needed.

```php
if (extension_loaded ('newrelic')) {
    newrelic_name_transaction ($controller . '/' . $action);
}
```

> #### 💡 TIP
>
> **Note:** Do not name your transactions with values that change often, such as user IDs, hashes, and so on. Implement [useful transaction naming](https://docs.newrelic.com/docs/agents/php-agent/features/php-frameworks-integrating-support-new-relic) in your API calls.

## Cause

New Relic probably cannot accurately detect or hook into your specific framework. This often occurs because the supported framework's default dispatching method has been modified (often by a plugin) or is no longer being used. If that happens, New Relic may not be able to detect or hook into the framework's dispatcher, and it will not be able to provide a meaningful transaction naming structure.
