A blank response from curl is a symptom, not a diagnosis. Start by inspecting the complete HTTP exchange with curl -i -v https://example.test/file.php, then repeat the request while watching Nginx and PHP-FPM logs. The most common causes are an incorrect SCRIPT_FILENAME, a PHP-FPM socket that is unavailable or points to the wrong pool, a missing or unreadable script, or a PHP fatal error hidden because display_errors is disabled.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What a blank curl response actually tells you
Seeing no HTML in a terminal does not prove that Nginx returned an empty successful page. The body may be empty because the server sent a redirect, an error response, a zero-length 200 OK, or a PHP process that failed before producing output. It can also be a client-side misunderstanding: a redirect may point to another URL, or the requested virtual host may not be the site you intended.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
Separate the layers before changing configuration:
- HTTP layer: status code, redirects, headers, and transfer details.
- Nginx routing layer: server block,
locationmatching,root,index, andtry_files. - Filesystem layer: the script path calculated from the request and whether the worker can traverse and read it.
- FastCGI transport: the
fastcgi_passsocket or TCP endpoint and its permissions. - PHP application layer: bootstrap code, configuration, dependencies, and runtime errors.
Each layer leaves different evidence. Do not “fix” PHP code when Nginx never found the file, and do not change try_files when PHP-FPM is refusing connections.
Step 1: Capture status, headers, redirects, and the body
Use a verbose request that includes response headers and the response body:
#1 Best Overall
- 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.
curl -i -v https://example.test/file.php
For a local virtual host, send the expected host name explicitly:
curl -i -v -H 'Host: example.test' http://127.0.0.1/file.php
Read the result in this order:
- Confirm that the connection reached the intended address and protocol.
- Record the HTTP status. A
200, redirect, client error, server error, and transport failure each require a different branch. - Check for a
Locationheader. A301,302, or another 3xx response may explain why the first body appears empty. Follow redirects only after recording the original response; add-Lwhen you want to test the destination as well. - Look for
Content-Length: 0or transfer headers indicating that the server intentionally sent no body. - Check the content type. A PHP response normally has an appropriate text or HTML type; a downloaded source file means the PHP location was not selected correctly and is a security problem.
curl -I performs a headers-only probe and can be useful for a quick check, but -i -v is better for a blank-body investigation because it shows the request, response headers, redirects, and any returned body together.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Interpret the first response
| Observed response | What it narrows down | Next evidence to collect |
|---|---|---|
200 OK with zero-length body |
PHP may have produced no output, terminated during startup, or been stopped by an application error. | PHP-FPM and application logs, followed by a direct diagnostic script. |
301 or 302 |
HTTP or application routing is sending the request elsewhere. | The Location value, host and scheme settings, and a second request to the destination. |
404 |
Nginx routing, URI mapping, or file existence is wrong before PHP runs. | Active location rules, root, try_files, and the requested path. |
502 Bad Gateway |
Nginx cannot complete the FastCGI connection. | fastcgi_pass, PHP-FPM service state, socket permissions, and timeout messages. |
| PHP source displayed or downloaded | The request was handled as static content instead of being passed to PHP-FPM. | Which location matched and whether it contains fastcgi_pass. |
Step 2: Watch Nginx and PHP-FPM logs during one request
Open separate terminals, start watching the configured Nginx error and access logs plus the PHP-FPM or application error log, and then make exactly one curl request. Correlating one request with one set of log lines is more reliable than making many configuration changes and trying to infer which one mattered.
Nginx identifies access.log and error.log as its primary troubleshooting files. Their locations depend on the distribution, virtual-host configuration, container image, and service unit. Find the active paths from the loaded configuration instead of assuming that every system uses the same filename or directory. A typical diagnostic pattern is:
sudo tail -f /path/to/nginx/error.log /path/to/nginx/access.log
Use the corresponding configured PHP-FPM or application log in another terminal. The important part is not the exact path but that you are reading the log used by the running pool and application.
Rank #2
- 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
Messages have distinct meanings:
- “Primary script unknown” or “No input file specified”: PHP-FPM received a script path that does not exist in its filesystem view. Check
rootandSCRIPT_FILENAME. - Permission denied: the worker cannot traverse a parent directory, read the script, or access the socket.
- Upstream connection refused, unavailable, or timed out: Nginx cannot reach the configured PHP-FPM endpoint, or the pool is overloaded or stopped.
- Application fatal error: PHP started but failed during bootstrap, configuration loading, dependency loading, or request handling.
- No PHP-FPM entry at all: the request may have matched another Nginx location, been rejected before FastCGI, or gone to a different host or container.
Keep the logs attached while testing every later change. A successful curl response without a corresponding expected access-log entry usually means you are looking at the wrong server instance or virtual host.
Step 3: Validate the PHP location block
The PHP location must map the request URI to a real script and pass it to the intended PHP-FPM endpoint. A minimal pattern is:
location ~ .php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
The exact directives can differ by distribution and framework, but three values must agree:
root: the directory that actually contains the requested script.fastcgi_param SCRIPT_FILENAME: the absolute path PHP-FPM should open.fastcgi_pass: the live Unix socket or TCP address for the PHP-FPM service and pool you intend to use.
Nginx documentation states: “The SCRIPT_FILENAME parameter is used in PHP for determining the script name.” With the common expression $document_root$fastcgi_script_name, a request for /file.php under a root of /var/www/example/public becomes /var/www/example/public/file.php. That computed path must be the real path from the perspective of the PHP-FPM process, not merely a path that exists inside Nginx’s container or in a different deployment release.
Inspect the loaded configuration, not only the file you edited. Includes, an earlier regular-expression location, or a different server block may override the fragment you are reading. After a change, validate the syntax and reload the service through your platform’s normal procedure. A syntax check that fails must be corrected before any reload is attempted.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Rank #3
- 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)
Step 4: Confirm the PHP-FPM endpoint
fastcgi_pass can target a Unix socket such as unix:/run/php/php-fpm.sock or a TCP endpoint such as 127.0.0.1:9000. The socket path and port are version-, distribution-, pool-, and container-specific; do not copy an example path without checking the running service.
- Read the active Nginx configuration and record the exact
fastcgi_passvalue. - For a Unix socket, verify that the socket exists at that exact path and that the Nginx worker can connect to it.
- For TCP, verify that PHP-FPM is listening on the configured address and port, and that network policy permits the connection.
- Check the PHP-FPM service and pool state. A stopped service, crashed worker manager, wrong PHP version, or different pool can all leave Nginx pointing at an endpoint that is present in configuration but absent at runtime.
- Read the Nginx error log while making one request. Connection-refused and timeout messages distinguish transport failure from a script-path failure.
If the endpoint belongs to a different PHP version or pool, the request may reach PHP but use a different configuration, extension set, user, or filesystem namespace. Match the socket or port to the application’s active PHP-FPM service rather than choosing the first endpoint that exists.
Step 5: Prove the calculated file path exists and is readable
Derive the final path exactly as Nginx does, then test it on the server. For /file.php, concatenate the active root and fastcgi_script_name; do not substitute a path from a development machine.
- Confirm that the file exists at that exact location.
- Check every parent directory for execute (traverse) permission.
- Check that the PHP-FPM worker user can read the file.
- Check symlink targets. A link may point outside the deployed document root or to a path that is not mounted in the PHP-FPM container.
- Check for release-directory or container mismatches, where Nginx and PHP-FPM see different filesystem roots.
- Check accidental path changes such as an extra slash, a stale deployment directory, or a document root that points at the project directory instead of its public directory.
Test permissions as the actual service account where possible. The account name varies by operating system and pool configuration, so identify it from the PHP-FPM pool rather than assuming a universal user. A file that is readable by your interactive account can still be unreadable by the worker.
Use try_files without breaking front-controller routing
Nginx can verify that a PHP file exists before passing it upstream. Its documentation describes try_files as checking the existence of the PHP file before handing the request to FastCGI. A direct-script pattern might look like:
Rank #4
- 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
location ~ .php$ {
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
This prevents a missing script from being sent to PHP-FPM and makes a path error an explicit 404. However, frameworks that route every friendly URL through index.php need a different arrangement: the outer application location should route the URI to the front controller, while the PHP location handles the resulting real script. Blindly appending =404 to a front-controller setup can reject valid application routes.
Use the request model that matches your application:
- Direct PHP files: check the requested script before FastCGI.
- Front controller: test the public entry script and preserve the framework’s fallback routing.
- Static-only path: do not send it to PHP merely because the URI contains a suffix that resembles a script.
Step 6: Separate PHP execution from the application
Create a temporary diagnostic file in the same document root, with deliberately simple output:
Recommended Free Tools
<?php
header('Content-Type: text/plain');
echo 'php-ok';
Request that file directly with curl. Remove it immediately after testing.
- If it returns
php-ok: Nginx, the FastCGI path, and basic PHP execution are working. The original application likely fails while loading configuration, dependencies, bootstrap code, or generating output. - If it is also blank or errors: remain at the Nginx, path, permissions, socket, PHP-FPM, or logging layer. The application has not yet been isolated as the cause.
- If the source is shown: the PHP location is not being selected or does not pass the request to FastCGI. Treat this as a serious configuration issue and stop serving the file until corrected.
Use a unique filename and a controlled environment. Never leave a diagnostic script in a public production directory because it confirms execution details to anyone who can request it.
Best Value
- 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.
Why PHP errors can produce an empty body
PHP’s display_errors setting controls whether errors are sent in the response. It may be disabled, especially in production, so the client can receive an empty body while the actual fatal error appears only in PHP-FPM or the application log. The PHP manual notes that changing display_errors at runtime with ini_set() does not necessarily affect fatal errors, because execution can stop before that setting takes effect.
Use the environment-appropriate approach:
- Development: temporarily enable visible errors if the environment is protected and the response cannot expose secrets. Reproduce once, capture the error, and disable verbose output afterward.
- Production: keep detailed errors out of the response, configure reliable server-side logging, and monitor the PHP-FPM and application logs. A generic HTTP error is safer than a stack trace containing credentials or filesystem paths.
- Both environments: verify that the log destination is writable, that the active PHP-FPM pool uses the configuration you changed, and that timestamps line up with the curl request.
If the logs show an application fatal error while the direct diagnostic script succeeds, fix the reported application condition rather than changing Nginx routing. Common examples include a missing dependency, invalid configuration, incompatible extension, or code path that emits no output before terminating.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsMatch the symptom to the least invasive fix
| Symptom | Likely layer | Fix to test |
|---|---|---|
200 OK with zero-length body and PHP-FPM log shows a fatal error |
PHP application | Fix the fatal error, inspect PHP-FPM and application logs, and do not rely on display_errors. |
| Nginx error log reports “Primary script unknown” or a missing input file | Path mapping or filesystem | Correct root and SCRIPT_FILENAME; verify that the computed file exists and is readable. |
502 Bad Gateway |
FastCGI transport | Check fastcgi_pass, PHP-FPM service state, socket path, permissions, and timeouts. |
404 before PHP runs |
Nginx routing | Check location matching, try_files, index, and the requested URI. |
Redirect loop or unexpected 301/302 |
HTTP or application routing | Use curl -i -v to inspect Location; verify scheme, host, and application URL settings. |
| PHP source downloaded or shown as text | Nginx handler | Ensure the PHP location is selected and uses fastcgi_pass; never serve PHP source as static content. |
Prefer reversible evidence-gathering first: a verbose curl request, a log tail, configuration inspection, and a temporary diagnostic script. Apply production behavior changes only after the failing layer is identified.
Container, deployment, and virtual-host traps
Nginx and PHP-FPM do not share the same mount
In a multi-container deployment, Nginx may see /var/www/app while PHP-FPM sees a different mount or release path. The SCRIPT_FILENAME value can look correct in Nginx logs yet point to a nonexistent path inside the PHP container. Make the application directory available at the same effective path in both containers, or use a path mapping that reflects the PHP-FPM filesystem.
The request reaches the wrong server block
A missing or unexpected Host header can select a default virtual host. Test with the intended host header, compare the access-log entry, and verify that the selected server block has the expected root and PHP location. This explains cases where editing one site’s configuration appears to have no effect.
A deployment switched the document root
Release directories and symbolic links often change during deployment. Nginx may point at the new release while PHP-FPM, a chroot, or a separate container still references the old path. Resolve the active root and symlink target at the time of the request, then test the resulting path from the PHP-FPM environment.
A repeatable decision procedure
- Run
curl -i -vand record status, headers, redirects, and body length. - Watch Nginx access and error logs plus the PHP-FPM or application log while repeating the same request.
- If the status is a redirect, inspect
Locationand correct host, scheme, or application URL routing. - If it is a 404, determine which Nginx location handled the URI and verify
root,index, andtry_files. - If it is a 502 or the error log reports an upstream failure, verify the live PHP-FPM service, socket or TCP endpoint, permissions, and timeouts.
- If the log reports an unknown script or missing input file, calculate
SCRIPT_FILENAMEand test that exact path from the worker’s filesystem and account. - If a direct diagnostic PHP file works, investigate the original application’s bootstrap and fatal errors.
- If the body is empty but logs show a fatal error, fix the application and keep production error details in server-side logs.
- Remove temporary diagnostic files and reload only the configuration that was proven to be wrong.
Production-safe checks before closing the incident
- Confirm the intended virtual host responds when addressed by its real host name.
- Confirm the PHP location passes scripts to the intended PHP-FPM pool.
- Confirm the computed script path exists, is inside the intended deployment, and is readable by the worker.
- Confirm a missing script fails predictably instead of being sent to an unrelated pool.
- Confirm application and PHP-FPM errors are recorded in monitored logs.
- Confirm verbose error display and temporary diagnostic files are disabled or removed.
- Repeat the original curl command and compare its status, headers, body, and corresponding log lines with the expected result.
A blank curl body is resolved when the evidence identifies its layer: HTTP routing, Nginx mapping, filesystem access, FastCGI transport, or PHP execution. Once those layers are checked in order, the fix is usually a precise path, endpoint, permission, routing, or application correction rather than a guess at what the browser failed to display.
Quick Recap
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.




