What is the difference between 'local value' and 'master value'?

What is the difference between 'local value' and 'master value'?

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Understanding PHP local value vs master value in phpinfo()

When you run phpinfo() and notice two distinct columns labeled Local Value and Master Value, it signals that your PHP application is running within a containerized environment or a managed hosting setup where configuration can be layered. This dual-column output isn't just a quirk; it's a critical diagnostic tool for understanding which settings are actually controlling your runtime behavior versus what the base system provides.

The fundamental distinction lies in the order of precedence. The Local Value represents the configuration directives currently active for that specific process. If a value is empty in this column, the engine falls back to the Master Value. Conversely, if a value exists in the Local column but remains identical to the Master column, it usually indicates that no explicit override has occurred at the application or container level, and the default system configuration is being used.

This architecture is common in environments like Docker, Kubernetes, or cloud platforms where you might spin up containers with specific requirements without modifying the host's global php.ini. The Master Value typically corresponds to the main PHP configuration file (often /etc/php/8.x/cli/php.ini or a system-wide config) and any additional .ini files loaded by that default installation. These settings define the baseline behavior of the PHP interpreter on the server.

The Local Value, however, is where runtime overrides happen. In a containerized scenario, this often comes from environment variables passed to the container at startup or from a local php.ini file placed in the root of your application directory if the PHP-FPM process is configured to look there first. For instance, you might set APP_ENV=production via an environment variable in your Docker Compose file or Kubernetes deployment spec. When PHP detects this, it populates the Local Value column for that specific directive.

It is crucial to understand that not all directives behave the same way regarding these layers. Some configuration options are hardcoded into the PHP binary itself and will never appear as a modifiable Local Value unless you compile with specific flags. Others might be read-only at runtime, such as php.display_errors. If you try to change these via an environment variable or a local config file, the Master Value will often override your attempt, resulting in an empty Local Value column that still reflects the restrictive default.

A common pitfall for developers is assuming that setting an environment variable like PHP_MEMORY_LIMIT inside a Dockerfile or pod specification guarantees an increase if the container's PHP binary was compiled with a hard limit on the host system. If the Master Value sets memory_limit to 128M and your local override attempts to set it to 512M, but the directive is restricted (which happens often in secure configurations), you might see an empty Local Value while the process crashes due to the lower Master limit. Always check which column actually holds a non-empty value before assuming your intended configuration has taken effect.

When debugging performance issues or unexpected behavior, focus on the Local Value first. If it is populated and differs from the Master Value, that is the setting currently in force. If it is empty, investigate whether the directive is restricted or if the Master Value is simply being used because no override was successfully applied. This distinction allows you to troubleshoot whether an issue stems from your specific application configuration or the underlying infrastructure defaults.

For teams managing large-scale deployments where consistency is key, understanding this hierarchy ensures that critical security and performance settings are enforced at the Master level while allowing flexibility for non-critical overrides at the Local level. If you need deeper insights into how these configurations interact within a specific framework ecosystem, resources like LaravelCompany often provide practical guides on managing PHP settings in modern Laravel applications without breaking production stability.

Our network