October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

Where to Find the PHP Error Log File on Linux

Linux has no universal PHP error-log filename. Learn how to identify the active SAPI, inspect effective PHP settings, and locate errors in a file, Apache, NGINX, PHP-FPM, syslog, journald or stderr.
Length8 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no single PHP error-log filename used by every Linux installation. Find the PHP SAPI handling the request, inspect that SAPI’s effective configuration, and then follow the destination set by error_log. It may be an explicit file, syslog, a web-server log, or standard error rather than a PHP-named file.

For web requests, CLI settings are not authoritative: Apache, PHP-FPM, CGI, and the command-line interpreter can load different php.ini files and pool or virtual-host overrides.

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 Linux PHP logs do not have one default path

PHP’s error_log directive names the destination for script errors. An absolute or relative filename sends messages to that file. The special value syslog sends them to the operating-system logger. If the directive is unset, PHP uses the active SAPI’s error logger; that commonly means Apache’s error log for an Apache module or stderr for CLI execution. The PHP Runtime Configuration documentation describes these behaviors in detail at php.net/manual/en/errorfunc.configuration.php.

Consequently, a search for /var/log/php_errors.log can fail even when PHP is logging correctly. Distribution packages, source builds, containers, and custom prefixes also change absolute paths. A request sent through NGINX may produce entries in NGINX’s error log, PHP-FPM’s service journal, a pool-specific worker log, or a file selected by the FPM pool configuration.

#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.
SAPI or request path First configuration to inspect Where errors may appear when no PHP file is set Important distinction
CLI The CLI php.ini CLI stderr CLI settings can differ from web settings.
Apache module PHP’s Apache-loaded configuration and the active Apache ErrorLog Apache’s error log Virtual hosts can override the global Apache destination.
PHP-FPM with NGINX FPM’s PHP configuration, pool file, and NGINX server/location blocks FPM/SAPI logger, NGINX error log, stderr, syslog, or journald FPM worker and slow-request logs are separate settings.
CGI or another SAPI The configuration loaded by that SAPI The SAPI’s own error logger Do not infer its destination from CLI output.

Step 1: Identify which PHP SAPI handles the failing request

Start with the execution path, not a guessed filename. A command typed in a shell uses CLI PHP. A page served by Apache may use an Apache module or proxy to PHP-FPM. NGINX normally forwards PHP requests to PHP-FPM or another CGI process. These paths can load separate configuration trees.

  • CLI: commands such as php script.php, Composer jobs, and cron tasks.
  • Apache module: Apache loads PHP directly into its worker process.
  • PHP-FPM: a separate manager and pool of PHP workers receives FastCGI requests.
  • CGI or a custom service: the process and its service unit determine the logger.

If only browser requests fail, do not rely on the output of php -i until you have confirmed that the browser and shell use the same SAPI and PHP version. A trusted, temporary phpinfo() page can show the web SAPI and loaded configuration; remove it immediately after checking because it exposes environment details.

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

Step 2: Inspect the effective PHP configuration

Check CLI PHP

Run these commands as the same user and on the same host that executes the script:

php --ini
php -i | grep -E 'log_errors|error_log|Loaded Configuration File'

php --ini reports the loaded php.ini and scanned additional files. The second command displays the effective values for the logging directives and the principal configuration file. If Loaded Configuration File is (none), PHP may still be reading files from the additional scan directory shown by php --ini.

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

Check the web SAPI

For Apache or PHP-FPM, inspect a trusted phpinfo() result or the service and pool configuration used by the request. Compare “Loaded Configuration File” and “Additional .ini files parsed” with the CLI output. In FPM installations, inspect the pool file for directives such as php_admin_value[error_log], php_admin_flag[log_errors], worker error logging, and slow-request logging. A pool-level setting can override a global file without changing the CLI result.

How to interpret error_log

Read the value exactly as PHP reports it:

Effective value Meaning Next place to look
An absolute path, such as /srv/app/log/php-error.log PHP writes to that file, provided logging is enabled and the process can open it. That exact path, its parent directories, and rotation rules.
A relative path PHP has a file destination, but the location is relative to the process’s runtime context and must be verified for the SAPI. Resolve it from the service or process environment rather than guessing a global directory.
syslog Messages go to the operating-system logger instead of a PHP-specific file. journalctl on systemd systems or the configured syslog collector.
Empty or unset PHP delegates to the active SAPI logger. Apache’s ErrorLog, NGINX/FPM service output, or CLI stderr.

The log_errors directive controls whether script errors are logged at all. It is server-specific, so verify its effective value in the same SAPI that handles the request. Keep display_errors disabled on an internet-facing production site: PHP documents screen display as a development feature and recommends logging instead.

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

Finding errors when Apache serves PHP

Apache’s ErrorLog directive sets the file receiving server errors. When PHP’s error_log is unset, PHP can write through the Apache SAPI logger. Read the active global and virtual-host configuration, not only a sample file. Apache’s directive documentation is at httpd.apache.org/docs/2.4/mod/core.html.

Search the configuration tree for active directives:

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)
grep -RInE '^[[:space:]]*ErrorLog[[:space:]]+' /etc/apache2 /etc/httpd 2>/dev/null

On systems with multiple virtual hosts, identify which host handled the request and check that host’s ErrorLog. A global setting may point to one file while a site-specific block points elsewhere. If the directive is syslog: or another logger form, follow that logger instead of looking for a regular file. Apache can also report startup and permission failures before PHP runs, so check its service status and recent service messages when the request never reaches PHP.

Finding PHP-FPM errors behind NGINX

Inspect NGINX’s effective error destination

NGINX’s error_log directive accepts a file, stderr, or syslog and can be set in main, http, mail, stream, server, or location context. Its documented default is logs/error.log, but the absolute path depends on the operating system and installation method. Distribution packages commonly use /var/log/nginx/error.log on RHEL, Debian, and Ubuntu systems.

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

Check the compiled-in path:

nginx -V 2>&1 | sed -n 's/.*--error-log-path=([^ ]*).*/1/p'

Then inspect nginx.conf and included files for error_log directives. A server or location block can override a setting inherited from http. If NGINX logs to stderr, the destination may be the service manager’s journal or a container runtime log rather than a host file.

Inspect PHP-FPM separately

NGINX records proxy, FastCGI, and connection errors; PHP-FPM records errors generated by workers and can define separate worker and slow-request logs. Check the FPM service unit and pool configuration. Service names include a PHP version on many distributions, so list the installed units instead of assuming one name:

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
systemctl list-units --type=service 'php*-fpm.service'
journalctl -u php8.2-fpm --since today

Replace php8.2-fpm with the unit actually installed. If the unit writes to a file, follow the path in its FPM configuration. If it writes to standard error, read the unit’s journal. A PHP error absent from NGINX’s file can therefore still be present in FPM’s journal or pool log.

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

Syslog, journald, and containers

With PHP error_log = syslog, query the system logger rather than a PHP directory. On systemd systems, start with the service that owns the process:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
journalctl -u nginx --since today
journalctl -u php8.2-fpm --since today

Use the actual FPM unit name and narrow the time range around a reproduced request. Traditional syslog systems may route PHP or NGINX messages by facility to files configured by the local collector. Search the collector configuration and inspect the facility named by the service; there is no universal filename.

Containers change the boundary again. An image may intentionally send NGINX or FPM errors to stderr. In that case, read the container runtime’s logs rather than the host’s /var/log tree. A bind mount, sidecar collector, or orchestration platform may then forward those records to a centralized destination. Verify the container’s process command and logging driver before changing PHP settings.

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.

When the expected log file is empty or missing

  1. Confirm the request reaches the expected SAPI. Reproduce the failure through the same URL, virtual host, port, and PHP version that users invoke. A CLI test can be successful while the web request uses another configuration.
  2. Verify log_errors. If it is off in the effective web configuration, PHP will not write script errors to the configured destination.
  3. Read error_log exactly. An empty value points you to the SAPI logger; syslog points you to journald or syslog; a path points you to that file.
  4. Check permissions and directory traversal. The web-server or FPM account must be able to create or append to the file and execute (traverse) every parent directory. A writable file is insufficient if a parent directory blocks traversal.
  5. Check rotation and renames. Log rotation can move the old file, compress it, create a new inode, or temporarily change ownership. Inspect the rotation configuration and the newest file’s timestamp.
  6. Check the service journal. Open failures, denied writes, crashed workers, and configuration syntax errors may be reported by systemd even when the application log remains empty.
  7. Check server-level overrides. Apache virtual hosts, NGINX locations, and FPM pools can override inherited settings. Search included configuration files, not only the main file.

To test a known destination without exposing errors in a browser, trigger a controlled application error in a non-public environment and observe the configured file or logger. Avoid enabling verbose display on a production site while diagnosing.

Permissions, rotation, and production safety

PHP’s documentation specifies that the configured error-log file must be writable by the web server’s user. Determine the account used by Apache or the FPM pool, then verify ownership, mode bits, ACLs, and parent-directory traversal. Do not solve a write failure by making the entire log directory world-writable; grant the service account only the access it needs.

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.

Plan rotation for any file destination. Rotation should preserve the service account’s ownership, signal or reload the service when required, and retain enough history to investigate recurring failures. Journald and syslog also have retention and rate-limiting policies; an apparently missing old entry may have expired or been suppressed.

Keep display_errors off for production responses. Error pages can reveal filesystem paths, SQL details, credentials, or stack traces. Logging preserves diagnostic information without sending it to visitors, while access to the logs should be restricted to administrators and approved operators.

A repeatable diagnostic checklist

  • Record whether the failure is CLI, Apache, NGINX, PHP-FPM, CGI, or a container request.
  • Run php --ini for CLI and compare it with the web SAPI’s trusted phpinfo() or service configuration.
  • Read effective log_errors and error_log values.
  • Follow the destination type: file, Apache ErrorLog, NGINX error_log, FPM pool/service log, stderr, syslog, or journald.
  • Check the service account’s write and traverse permissions.
  • Inspect rotation, retention, and recent service-manager messages.
  • Remove temporary diagnostics and keep display_errors disabled on public production systems.

This process finds the active destination even when a distribution has changed package paths, a virtual host overrides the global server setting, or a container replaces files with standard-error logging.

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.

Leave a Reply

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

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.

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
Crashes, No Sound, or Screen Glitches?Free driver scan

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.