Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Nginx PHP Changes Not Applying? Fixing php.ini Not Taking Effect

When php.ini edits do not appear through Nginx, the web request is usually using a different PHP-FPM configuration or an override. This guide shows how to trace the active SAPI, inspect every layer, reload the correct FPM service, and confirm the result.
Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a value in php.ini still looks unchanged through an Nginx site, the usual cause is that you edited the CLI configuration instead of the PHP-FPM configuration, or that a pool, Nginx FastCGI parameter, or old worker process is overriding it. Nginx does not load php.ini or execute PHP; PHP-FPM does.

Prove the configuration used by a real HTTP request, identify the FPM socket or port behind Nginx, inspect every override layer, reload that exact FPM service, and test again with a fresh request.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why an Nginx request can ignore your php.ini edit

Nginx handles the HTTP connection and forwards PHP requests to PHP-FPM through FastCGI. PHP-FPM workers load PHP configuration and execute the script. Consequently, restarting or reloading Nginx alone does not make PHP-FPM reread its configuration.

There are also separate PHP installations or SAPIs on many servers. The command-line SAPI may read one file while the FPM SAPI reads another. A value shown by php --ini therefore describes the CLI binary, not necessarily the PHP process serving your website.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
  • CLI PHP: used by commands such as php --ini; it can have a different version and configuration tree.
  • PHP-FPM: the long-running service connected to Nginx; its master process selects an FPM php.ini, additional .ini files, a global FPM file, and one or more pool files.
  • Nginx FastCGI parameters: a server or location block can pass PHP_VALUE or PHP_ADMIN_VALUE for an individual request.
  • Application code: ini_set() can change directives whose PHP_INI mode allows it, but not administrative values.

PHP documents that “FPM uses php.ini syntax for its configuration file – php-fpm.conf, and pool configuration files.” See the PHP-FPM configuration manual.

1. Prove what the web request actually loads

Before changing files, create a short diagnostic endpoint in the same virtual host and document root as the failing request. It reports the SAPI, the loaded main file, parsed additional files, and the value you are troubleshooting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
header('Content-Type: text/plain');
echo 'SAPI: ' . PHP_SAPI . PHP_EOL;
echo 'Loaded php.ini: ' . (php_ini_loaded_file() ?: 'none') . PHP_EOL;
echo 'Scanned .ini files: ' . (php_ini_scanned_files() ?: 'none') . PHP_EOL;
foreach (['memory_limit', 'upload_max_filesize', 'post_max_size'] as $name) {
    echo $name . ': ' . ini_get($name) . PHP_EOL;
}
?>

Replace the example directive names with the setting you need to check. Restrict the endpoint with your normal administrative access controls or an IP allow-list; configuration paths and server details should not be public. Delete the file immediately after testing.

Run the CLI comparison separately:

php --ini
php -r 'echo PHP_SAPI, PHP_EOL, php_ini_loaded_file(), PHP_EOL;'

A difference between the endpoint and php --ini is not itself an error. It confirms that CLI PHP and FPM PHP are separate configuration contexts. The endpoint’s output is the authority for an Nginx request.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

2. Identify the PHP-FPM instance behind Nginx

Find the active fastcgi_pass in the Nginx configuration, including included files:

sudo nginx -T | grep -nE 'fastcgi_pass|PHP_VALUE|PHP_ADMIN_VALUE'

The result normally points to a Unix socket such as unix:/run/php/php-fpm.sock or to a TCP endpoint such as 127.0.0.1:9000. A versioned socket tells you which PHP-FPM installation is relevant. For a TCP endpoint, map the listening port to the corresponding service and pool configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

List candidate services before reloading anything:

systemctl list-units --type=service | grep -Ei 'php.*fpm|fpm.*php'
ps -ef | grep '[p]hp-fpm'

Match the service’s socket or listening address to the value in the active Nginx server and location block. If several PHP versions run at once, editing the file for an unused version cannot affect this site.

3. Understand the configuration layers and their scope

Inspect all layers instead of assuming the global file wins. Pool-specific directives are intentionally able to replace values from php.ini. The shipped FPM pool template says: “Additional php.ini defines, specific to this pool of workers. These settings overwrite the values previously defined in the php.ini.”

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

The following comparison shows where a fix belongs and what happens after it is changed.

Layer Typical scope Relationship to other settings Can ini_set() override it? Process boundary Security and portability
FPM php.ini and scanned .ini files All pools using that FPM installation Base configuration; later scanned files can replace earlier declarations Depends on the directive’s PHP_INI mode Reload or restart that FPM service Portable concept; filesystem paths differ by distribution
Global php-fpm.conf That FPM master process Uses php.ini syntax; affects the master and included pool definitions Depends on the directive Reload or restart the matching FPM service Keep ownership and permissions restricted
Pool www.conf or another pool file One FPM pool, often one site or group of sites php_value/php_flag set classic values; php_admin_value/php_admin_flag impose administrative values php_value and php_flag may be changed when permitted; administrative forms cannot Reload or restart the matching FPM service Good isolation; pool filenames and locations vary
Nginx PHP_VALUE A server, location, or request selected by Nginx Passed to FPM as FastCGI request parameters Directive mode still applies Reload Nginx after changing this block, then make a new request Do not expose the FPM endpoint publicly
Nginx PHP_ADMIN_VALUE A server, location, or request selected by Nginx Passed as an administrative request value No, for the administrative setting Reload Nginx, then make a new request Review included snippets and every matching location
PHP ini_set() One request after application startup Runtime change only where the directive permits it Not applicable No service reload, but it cannot affect startup-time behavior Least suitable for global policy or upload parsing

For an exact directive, check its PHP_INI mode in the documentation for the PHP version installed on the FPM service. A setting marked administrative cannot be relaxed by application code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Inspect every FPM file for the directive

Use the path printed by the diagnostic endpoint, then inspect the FPM configuration tree used by that binary. Common layouts include an FPM-specific directory under /etc/php/, /etc/php-fpm.d/, or /etc/php-fpm.d; the location is distribution-dependent.

sudo grep -RniE 'memory_limit|upload_max_filesize|post_max_size' /etc/php /etc/php-fpm.conf /etc/php-fpm.d 2>/dev/null

Search for the exact setting in:

  • the FPM php.ini named by the HTTP diagnostic;
  • the directory reported by php_ini_scanned_files();
  • the global php-fpm.conf and its include directives;
  • the pool file selected by the running master process; and
  • any included pool snippets.

Record duplicate definitions and their locations. A value that looks correct in the global file can still be replaced by a later scanned file or a pool directive.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

5. Check Nginx for FastCGI overrides

In the server block handling the request, its PHP location, and all included snippets, search for both parameter names:

sudo nginx -T | grep -nE 'fastcgi_param[[:space:]]+PHP_(VALUE|ADMIN_VALUE)'

The PHP manual demonstrates this pattern:

set $php_value "pcre.backtrack_limit=424242";
set $php_value "$php_value n pcre.recursion_limit=99999";
fastcgi_param PHP_VALUE $php_value;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www/htdocs";

These parameters apply at request time and can make a correctly edited FPM file appear ineffective. Check that the request reaches the intended server and location block; another virtual host or an included configuration may contain a different value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Because the settings are transmitted as FastCGI headers, the manual warns: “Because these settings are passed to php-fpm as fastcgi headers, php-fpm should not be bound to a worldwide accessible address. Otherwise, anyone could alter the PHP configuration options.” Keep FPM on a protected Unix socket or a firewall-restricted private interface, never on an openly reachable address.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

6. Choose the right layer for the directive

Use a pool value for site-level policy

When one site needs a different limit from other sites sharing the installation, set it in that site’s pool. The pool template distinguishes the forms: “php_value/php_flag – you can set classic ini defines which can be overwritten by PHP call ‘ini_set’.” It then states: “php_admin_value/php_admin_flag – these directives won’t be overwritten by PHP call ‘ini_set’.” Choose the administrative form when application code must not relax the policy.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Do not rely on ini_set() for request parsing limits

Upload and POST limits can be evaluated while the request body is being accepted, before application code runs. Changing a value inside the script is therefore not a substitute for setting the correct FPM or web-server layer. Configure the relevant limit before the request arrives and verify the effective value through HTTP.

Use Nginx parameters sparingly

Nginx parameters are useful when a value is tied to one virtual host or location, but they add a second configuration language and another place to search. Document the reason for each parameter and inspect generated configuration with nginx -T.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Reload the process that owns the socket

After editing an FPM file, reload the exact service whose socket or port appears in fastcgi_pass. Service names differ by distribution and PHP version; examples include:

sudo systemctl reload php8.3-fpm
sudo systemctl reload php-fpm

Use the name actually installed on your host. If the service does not support a graceful reload, follow its documented restart procedure; a restart drops existing workers and should be planned for production traffic.

If you changed an Nginx fastcgi_param or routing block, validate and reload Nginx as well:

sudo nginx -t && sudo systemctl reload nginx

Then make a new HTTP request. Existing FPM workers can continue serving old settings until the matching FPM master performs the reload, so refreshing a browser immediately after an Nginx-only reload is not a valid test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

8. Diagnose the common failure patterns

What you observe Likely cause What to check next
php --ini shows your edit, but the endpoint does not You edited the CLI SAPI Use the endpoint’s php_ini_loaded_file() and scanned-file list; edit the FPM tree
The endpoint reports an unexpected PHP version or file Nginx points to another version’s socket or port Compare fastcgi_pass with the running FPM service and pool
The global value is correct, but the endpoint remains different A pool php_value or php_admin_value overrides it Search all pool files and included snippets for the directive
Only one virtual host has the wrong value An Nginx parameter or a different pool applies to that host Inspect the selected server/location block and pool assignment
The file is correct after editing, but requests are unchanged The relevant FPM workers were not reloaded Reload the service owning the active socket, then retest over HTTP
Different hostnames show different values A proxy, cache, alternate virtual host, or separate backend handled the request Test the intended hostname directly and confirm the response headers and endpoint location

9. Verify the fix without guessing

  1. Request the temporary endpoint through the exact hostname and URL used by the application.
  2. Confirm PHP_SAPI is an FPM SAPI and note the loaded php.ini path.
  3. Confirm the target directive’s displayed value and check whether additional files are listed.
  4. Compare the endpoint with the active Nginx configuration from nginx -T.
  5. After every FPM or Nginx change, perform a fresh request rather than relying on a browser cache or an old response.
  6. Remove the diagnostic endpoint and keep a record of the final file, pool, and service changed.

If the value still differs after these checks, that difference is evidence of a configuration layer or backend you have not yet identified—not proof that PHP ignored a valid setting. Trace the request from the hostname to the Nginx location, then to its FastCGI socket, pool, and FPM version until every step matches the endpoint output.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.