Free tools Windows power users keep installed

One-click scans. No signup required.

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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A blank body from curl is a symptom, not a diagnosis. The response may actually be a redirect, an error, or a successful HTTP response whose PHP process produced no output. Start with curl -i -v to see the status line, headers, redirects, and body, then repeat the request while watching Nginx and PHP-FPM logs.

For PHP requests, the most important configuration checks are the selected Nginx location block, its fastcgi_pass endpoint, and the value generated for fastcgi_param SCRIPT_FILENAME. That path must point to the real, readable script beneath the active Nginx root. A temporary diagnostic PHP file can then separate a web-server problem from an application failure.

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

What a “blank page” actually tells you

curl prints the response body by default. If the terminal appears empty, you know only that no visible body reached the terminal. You do not yet know whether Nginx returned a zero-length 200 OK, followed a redirect, generated a 404 or 502, or passed the request to PHP and received no output.

The HTTP status and headers determine the next branch of the investigation:

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
What you observe Most likely layer First check
200 OK with a zero-length body PHP application or output generation PHP-FPM and application error logs; reproduce with verbose curl
301 or 302 HTTP or application routing Inspect the Location header and request the intended scheme and host
404 before PHP runs Nginx routing Check location matching, try_files, index, and the URI
502 Bad Gateway FastCGI transport Check the PHP-FPM service, socket or TCP endpoint, permissions, and timeouts
PHP source appears as text or downloads Nginx handler selection Ensure the PHP location uses FastCGI instead of serving the file statically
Nginx reports “Primary script unknown” or a missing input file Filesystem path mapping Correct root and SCRIPT_FILENAME, then verify the resulting file

A genuinely empty 200 response and a blank-looking terminal caused by a redirect are different failures. Do not change PHP settings until you have established which response you are receiving.

Step 1: Inspect the response on the wire

Use a request that includes both headers and verbose connection details:

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.
curl -i -v https://example.test/file.php

The -i option prints response headers with the body. The -v option shows the connection, request headers, TLS or proxy details, and response exchange. Record the status line, any Location header, Content-Length, Content-Type, and whether a body follows the headers.

For a local virtual host, the hostname in the URL may not resolve to the machine you are testing. Send the expected host header explicitly:

curl -i -v -H 'Host: example.test' http://127.0.0.1/file.php

That test reaches loopback while allowing Nginx to select the intended server block. Compare it with a request made through the public hostname if a proxy, TLS terminator, or load balancer sits in front of Nginx.

curl -I is useful when you only need headers, but it is not the best first probe for an empty PHP response. A headers-only request can use different request handling from a normal GET, and it cannot show whether the application emitted a body. Prefer -i -v while diagnosing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Interpret the status before changing configuration

  • 3xx: Follow the Location value manually and determine whether the redirect is intentional. A scheme, host, or application URL mismatch can create a loop or send you to a route you did not test.
  • 4xx: Establish whether Nginx rejected the URI or the application generated the response. The Nginx access and error logs, along with the response headers, usually identify the layer.
  • 5xx: Read the error logs immediately. A 502 usually means Nginx could not communicate with PHP-FPM; a PHP fatal error may instead result in a 500 or an empty 200, depending on the application and error handling.
  • 200 with no bytes: Treat it as an execution or output problem until logs and a direct test prove otherwise.

Step 2: Watch Nginx and PHP-FPM logs while reproducing

Open separate terminals, start log watches, and make one curl request. Nginx troubleshooting normally involves its configured access.log and error.log. PHP-FPM and the application have their own error destination. Paths and filenames vary by distribution, package, pool, container image, and service configuration, so discover the active paths rather than assuming a particular filename.

tail -f /path/to/nginx/error.log
tail -f /path/to/nginx/access.log
tail -f /path/to/php-fpm-or-application-error.log

Use the active Nginx configuration and the PHP-FPM service or pool configuration to identify the real files. If the service runs in a container, inspect the container’s logs and filesystem; a path on the host may not exist inside the container. Make a single request after the watches are running so that each new line can be tied to that request.

Messages that narrow the fault

  • “Primary script unknown” or “No input file specified”: PHP-FPM received a script path that does not identify a readable file. Check the Nginx root, URI-to-file mapping, and SCRIPT_FILENAME.
  • Permission denied: The worker cannot traverse a parent directory or read the script. Check ownership, mode bits, access-control policies, and the identity used by PHP-FPM.
  • Upstream connection refused, no such file, or timeout: Nginx cannot reach the configured FastCGI endpoint. Check the running PHP-FPM service, socket path, TCP listener, and permissions.
  • Application fatal error: The FastCGI path worked; fix the bootstrap, configuration, dependency, or application code named in the PHP-FPM or application log.

The access log confirms what Nginx returned. The error log explains routing and upstream failures. The PHP-FPM or application log is where execution errors generally appear. Reading only one of these can make a correct diagnosis look impossible.

Step 3: Validate the PHP location block

Nginx must select a PHP location and pass the request to the PHP-FPM endpoint. A minimal pattern is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
location ~ .php$ {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php/php-fpm.sock;
}

This is a pattern, not a universal copy-and-paste configuration. The socket name is distribution- and PHP-version-specific, and a site may use a TCP endpoint instead. The endpoint in fastcgi_pass must be the live socket or listener for the intended PHP-FPM service and pool.

Nginx’s FastCGI documentation identifies SCRIPT_FILENAME as the parameter PHP uses to determine the script name. In the example above, Nginx combines its active root with $fastcgi_script_name. For a request for /file.php, the resulting path must be the actual filesystem path to that file, not a path in another release directory, container, or document root.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Confirm which configuration Nginx is actually using

When several virtual hosts or include files exist, edit neither a guess nor an inactive copy. Inspect the loaded configuration, identify the server block selected for the test host, and verify its root, PHP location, include files, and fastcgi_pass. After a change, validate the configuration before reloading Nginx and then repeat the same curl request.

A common failure is a correct-looking PHP block in one server block while the request is handled by another block because the host, port, or default-server selection differs. The explicit Host test in the first step helps expose that mismatch.

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

Do not lose required FastCGI request parameters

The standard parameter include supplies request information used by PHP, including the query string and other CGI variables. Preserve the parameters required by your application, especially when handling POST requests. Changing only SCRIPT_FILENAME should not accidentally remove the rest of the FastCGI parameter set.

Step 4: Prove the script path and permissions

Take the URI from curl and calculate the path Nginx is sending to PHP-FPM. Then test that exact path on the server, using the same filesystem namespace seen by the PHP-FPM worker.

  • Confirm that the file exists at the computed location.
  • Confirm that every parent directory is traversable by the Nginx/PHP-FPM identity.
  • Confirm that the worker can read the PHP file.
  • Check for an unintended extra slash, a wrong release directory, or a symlink that points outside the expected tree.
  • If Nginx and PHP-FPM run in different containers, verify that both see the same mounted path; a host path is not automatically a container path.

A path can look correct in the Nginx configuration and still be wrong at runtime. The decisive test is whether the PHP-FPM process can open the exact file named by SCRIPT_FILENAME.

Use try_files as an early existence check

Nginx can check that a PHP file exists before passing the request upstream. A typical form is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
location ~ .php$ {
    try_files $uri =404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/run/php/php-fpm.sock;
}

The Nginx documentation describes try_files as checking for the PHP file before passing the request to FastCGI. This prevents a missing script from reaching PHP-FPM and makes the failure an explicit Nginx 404.

Apply this only when it matches the application’s routing model. A front-controller application may intentionally send many virtual URLs to index.php. Blindly appending =404 can break those routes. Keep the existence check consistent with the framework’s intended entry point and rewrite rules.

Step 5: Confirm the FastCGI endpoint is alive

Even a perfect script path cannot work if Nginx is pointed at the wrong PHP-FPM endpoint. Check all of the following:

  • The PHP-FPM service for the intended PHP version is running.
  • The Unix socket named by fastcgi_pass exists, or the configured TCP address and port are listening.
  • The Nginx worker has permission to connect to the Unix socket.
  • The pool serving the request has not stopped, exhausted its workers, or been blocked by a timeout.
  • Nginx and PHP-FPM agree about the network namespace when they run in separate containers or hosts.

Do not replace a socket path with a familiar filename without checking the active service. Package conventions differ, and a server can have more than one PHP version installed. A socket for an unused version may exist while the configured pool is stopped, or the running pool may listen on a different path.

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

A transport failure normally produces a 502 and an upstream error in Nginx’s error log. That evidence points to fastcgi_pass, service state, socket permissions, or timeout settings—not to PHP application output.

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

Step 6: Separate PHP execution from application routing

Create a temporary, controlled script in the same document root:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
<?php
header('Content-Type: text/plain');
echo "php-okn";

Save it as a new file such as php-check.php, request it directly, and remove it immediately after the test.

curl -i -v https://example.test/php-check.php

If the response contains php-ok, Nginx, FastCGI transport, path mapping, and basic PHP execution are broadly working. The original script is then more likely to fail during bootstrap, configuration loading, dependency initialization, authentication, or output generation.

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

If the diagnostic file also fails, stay at the Nginx location, root, SCRIPT_FILENAME, file permissions, PHP-FPM endpoint, and service-log layers. Do not spend time debugging application code until this smallest PHP request succeeds.

The diagnostic file should not remain publicly accessible. It confirms execution but exposes an unnecessary endpoint, so delete it after the request and clear any deployment artifact that could recreate it.

Step 7: Treat invisible PHP errors as a logging issue

PHP’s display_errors setting controls whether errors are sent in the response. Production configurations commonly disable it, which can leave curl with an empty body while the actual fatal error is recorded in PHP-FPM or the application log.

There is an additional trap: changing display_errors at runtime with ini_set() does not necessarily affect fatal errors. A fatal error can occur before the setting takes effect, so adding a runtime switch to the failing script is not a reliable diagnostic method.

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

In a non-production environment, you may temporarily enable verbose display to accelerate local debugging, while still collecting logs. In production, keep detailed errors out of the response and configure reliable server-side logging instead. Verify that the PHP-FPM pool and application logger write to files or a centralized service that the operating team can read and monitor.

When the body is empty but the log is not

Some applications deliberately suppress output, terminate early, or send a response through a framework handler. Check whether the script calls an exit path, buffers output, returns an empty template, or emits content under a condition that your curl request does not satisfy. Compare request headers, cookies, query parameters, and host or scheme with a known-working request, but make the comparison only after the direct PHP test and logs show that the server path works.

Fixes matched to the evidence

Observed evidence Layer Fix to test
200 OK, zero-length body, PHP-FPM log contains a fatal error PHP application Fix the fatal error and inspect the PHP-FPM/application log; do not rely on visible errors
Nginx says “Primary script unknown” or reports a missing input file Path mapping or filesystem Correct root and SCRIPT_FILENAME; verify 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 is downloaded or displayed as text Nginx handler Ensure the PHP location is selected and uses fastcgi_pass; never serve PHP source as a static file

A repeatable troubleshooting checklist

  1. Run curl -i -v against the exact URL. If virtual-host selection matters, add the correct Host header.
  2. Classify the result as a redirect, 4xx, 5xx, zero-length 200, or source download. Note Location, Content-Length, and Content-Type.
  3. Watch Nginx access and error logs plus the PHP-FPM or application error log, then make one identical request.
  4. Confirm the active server block, PHP location, Nginx root, and fastcgi_pass endpoint.
  5. Compute the SCRIPT_FILENAME for the requested URI and verify that the PHP-FPM worker can traverse, open, and read it.
  6. Use an appropriate try_files check, while preserving front-controller routing where the application requires it.
  7. Request a temporary plain-text PHP diagnostic file and remove it after testing.
  8. If the diagnostic succeeds, debug the original application’s bootstrap and output path using its logs. If it fails, remain at the Nginx, filesystem, FastCGI, and PHP-FPM layers.
  9. Keep detailed errors out of production responses and rely on monitored server-side logging.

This sequence minimizes guesswork because each step uses evidence from a different layer: the HTTP exchange, Nginx routing, filesystem mapping, FastCGI transport, and PHP execution. Changing a setting without identifying the failing layer can conceal the original error or introduce a second one.

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.

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