--- 
canonical: 'https://mwop.net/blog/2024-08-27-til-php-fpm-admin-value.html'
title: 'Configuring PHP.INI settings in a PHP-FPM pool'
author: "[Matthew Weier O'Phinney](https://mwop.net)"
created: '2024-08-27T17:37:30-05:00'
updated: '2024-08-27T17:37:30-05:00'
tags:
  - php
  - php-fpm
  - til

---
I consume PHP via Docker primarily, and to keep it manageable, I generally use a PHP-FPM container, with a web server sitting in front of it. I learned something new about PHP configuration recently that (a) made my day, and (b) kept me humble, as I should have known this all along.





What was it? quite simply, the `php_admin_value` struct can be used to configure `php.ini` settings for the pool. This is a great alternative to _also_ adding PHP configuration settings via `php.ini` (or an include file for `php.ini`), as it allows you to keep the settings specific to that pool. That way, if you _must_ have multiple pools (e.g., to serve multiple applications from the same machine and/or same PHP version), you can still have separate configuration for each.

How does it work? In your pool configuration, add values to that struct:

```ini
php_admin_value[memory_limit] = 32M
php_admin_flag[error_reporting] = E_ALL & ~E_NOTICE & ~E_DEPRECATED
php_admin_flat[track_errors] = Off
; etc
```

With [ZendPHP](https://www.zend.com/products/zendphp-enterprise), we just launched some Ansible tooling, which operates on the assumption that you are deploying PHP-FPM — and as part of its operation, it creates a template for the FPM pool configuration, but not for the PHP SAPI. And this is fine! Because you can use the `php_admin_value` settings to configure the pool for the application you're deploying!

Looking forward to simplifying a few of my deployments with this!