October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Find Which PHP Handler Your LAMP Stack Is Using

A practical, safe method to identify whether a LAMP site's Apache virtual host uses mod_php, PHP-FPM, or another CGI/FastCGI handler—and to explain differing PHP versions.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The authoritative answer comes from the PHP process that serves an HTTP request, not from php -v in your shell. Create a temporary phpinfo() page in the virtual host you want to test, request it through the same hostname and HTTPS URL as the application, and read its Server API value. Then confirm that result against Apache’s loaded modules, virtual-host dispatch rules, and (when applicable) the PHP-FPM pool’s listening socket or port.

Apache 2.0 Handler normally means PHP is embedded through mod_php. FPM/FastCGI means Apache is forwarding the request to PHP-FPM. CGI/FastCGI means a CGI-family path is active, but it does not by itself prove that PHP-FPM is running. The checks below also explain why the web site’s PHP version can differ from the version shown by the CLI.

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.

Use the web request as your starting point

A LAMP server can have several PHP installations and SAPIs (Server API implementations) at once. The command php -v reports the command-line SAPI selected by your shell’s PATH; it does not tell you which binary or handler Apache invokes for a particular virtual host. A web request can therefore use a different PHP version, configuration file, extension set, and handler.

The most reliable procedure has two parts:

  1. Ask the target virtual host which PHP runtime actually handled an HTTP request.
  2. Match that result to Apache’s module and dispatch configuration, and to a running FPM pool if the request uses FastCGI.

Do this separately for each hostname, HTTPS listener, port, or virtual host that may have its own configuration. Testing one site’s URL does not establish the handler for every site on the server.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Create a temporary diagnostic page

1. Put the file in the tested document root

In the document root served by the virtual host, create a file such as handler-check.php containing:

<?php
phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES);
?>

phpinfo() outputs information about PHP’s configuration, including compilation options, extensions, the PHP version, server information, and configuration paths. The selected sections are enough to identify the SAPI and the configuration files without requesting every possible diagnostic section.

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.

2. Request the file through the real site URL

Open the file with the same conditions used by the application:

  • Use the application’s hostname, not an IP address or an unrelated default host.
  • Use the same HTTP or HTTPS scheme and listener.
  • Use the same port when the site is not on the standard port.
  • Use the same URL path and virtual host that serves the application.

For example, if the application is reached at https://app.example.test/, request https://app.example.test/handler-check.php. A request sent to another hostname can select a different Apache virtual host and produce a correct result for the wrong site.

3. Record the fields that identify the runtime

On the resulting page, record these values before changing anything:

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
  • Server API
  • PHP Version
  • Loaded Configuration File
  • Scan this dir for additional .ini files
  • Additional .ini files parsed
  • Server information and the web-server details shown by the page

Those fields describe the process that answered the browser request. The configuration paths are especially useful when the web runtime appears to have a different extension or setting from the CLI.

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

Interpret the Server API value

What the page reports Likely handler What must confirm it
Apache 2.0 Handler Embedded mod_php Apache’s module list should contain a PHP module; inspect the loaded PHP shared object and the PHP handler directive.
FPM/FastCGI PHP-FPM reached through FastCGI, usually via mod_proxy_fcgi Apache should have proxy_fcgi_module loaded and the virtual host should proxy to a socket or TCP endpoint that matches a running FPM pool.
CGI/FastCGI A CGI or FastCGI path; it may be classic CGI, fcgid, or another FastCGI arrangement rather than PHP-FPM Inspect AddHandler, SetHandler, mod_cgi, mod_cgid, or fcgid configuration and look for the executable or dispatcher handling PHP files.

These labels are recognition clues rather than a complete configuration audit. In particular, CGI/FastCGI does not prove that an FPM service is present. The Apache configuration and process manager checks below resolve that ambiguity.

Confirm the result in Apache

List loaded modules

Run the command provided by your distribution:

apachectl -M

On systems that use the Debian-style command name, use:

apache2ctl -M

Inspect the output for the module that corresponds to the web result:

  • A loaded PHP module supports the embedded mod_php interpretation.
  • proxy_fcgi_module supports Apache forwarding FastCGI requests to another process.
  • cgi_module or cgid_module indicates CGI support. It does not, by itself, identify which PHP executable or FastCGI manager is used.

The module list only tells you what Apache has loaded globally. A module can be available without being selected for a particular virtual host, so continue by inspecting the active site configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Find the virtual host and its included configuration

Locate the configuration file for the exact hostname and listener you tested. Check both the virtual-host block and files it includes. The dispatch rule is often one of the following:

  • AddHandler, which associates a file extension with a handler.
  • SetHandler, which assigns a handler directly, often inside a <FilesMatch> block.
  • ProxyPassMatch, which matches PHP paths and forwards them to a FastCGI socket or TCP address.
  • A <FilesMatch> block that sets a proxy or CGI handler for files ending in .php.

For an embedded setup, the relevant rule and loaded PHP DSO cause Apache workers to invoke PHP inside the Apache process. For an FPM setup, the rule sends the request out of Apache to a separate FastCGI process. Do not infer the active handler from a disabled site file or an unused example configuration; it must be in the configuration Apache actually includes for the tested virtual host.

Recognize a typical FPM dispatch rule

Apache’s PHP-FPM examples route PHP requests to a Unix-domain socket or a TCP endpoint with ProxyPassMatch or SetHandler. Conceptually, the target might look like a socket path such as unix:/run/php/php-fpm.sock|fcgi://localhost/var/www/site, or a network endpoint such as 127.0.0.1:9000. The exact path and port are installation-specific; the important test is whether the target in the active virtual host matches the endpoint advertised by a running pool.

Verify PHP-FPM when FastCGI is reported

Check the service manager

Inspect the service name used by the operating system. Depending on the package and PHP version, it may be named php-fpm or a versioned service such as php8.2-fpm. Use your system’s service-manager status command with the name installed on that host, for example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
systemctl status php-fpm
systemctl status php8.2-fpm

A running service is necessary for a live FPM endpoint, but service status alone does not prove that the tested virtual host uses it. A server can run several pools while a site still points to another pool, another version, or an old socket.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Match the pool’s listen value to Apache

Open the pool configuration used by the running service and find its listen setting. It will normally be a Unix socket path or a TCP address and port. Compare it character-for-character with the target in the active Apache ProxyPassMatch or SetHandler rule:

  • If Apache targets a Unix socket, the socket path must be the same path the pool listens on.
  • If Apache targets a TCP endpoint, the address and port must match the pool’s listen value.
  • Permissions on a Unix socket must allow the Apache process to connect.

Finally, reload the tested URL and confirm that its Server API reports FPM/FastCGI. The matching configuration, running pool, and HTTP result together establish the active path. If one element does not match, you may be looking at a stale configuration, a different virtual host, or a different FPM pool.

Compare the web runtime with the CLI runtime

Print unambiguous values in the temporary page

For a compact comparison, create a second temporary page or replace the diagnostic body with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
<?php
printf("PHP_VERSION=%sn", PHP_VERSION);
printf("PHP_SAPI=%sn", PHP_SAPI);
printf("php_ini_loaded_file=%sn", php_ini_loaded_file() ?: "none");
printf("php_ini_scanned_files=%sn", php_ini_scanned_files() ?: "none");
?>

The constants and functions report the web request’s version, SAPI, primary configuration file, and scanned additional INI files. Keep the output private while testing; it is still diagnostic information.

Run the corresponding CLI checks

In the shell, run:

php -v
php --ini

Compare the results line by line:

Value Web page CLI command Meaning when different
PHP version PHP_VERSION or the PHP Version field php -v The web server and shell may select different PHP installations or package versions.
SAPI/handler PHP_SAPI and Server API CLI output identifies the command-line SAPI Different SAPIs are expected; only the HTTP value describes the website.
Main INI file php_ini_loaded_file() php --ini Each SAPI can load a different configuration file.
Additional INI files php_ini_scanned_files() The additional .ini files line from php --ini Extensions and settings can differ because the scanned directories or enabled files differ.

A mismatch is not automatically an error. Web and CLI PHP are commonly maintained as separate installations or SAPIs. If the question is “which PHP does my site use?”, treat the HTTP result as authoritative; use the CLI result only to understand command-line tools, cron jobs, and deployment scripts.

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

Understand the handler choices

Comparison point mod_php (embedded) PHP-FPM through FastCGI CGI or fcgid
Where PHP runs Inside Apache workers In separate PHP-FPM worker processes Through a CGI/FastCGI executable or dispatcher; the exact process model depends on the implementation
Typical Server API Apache 2.0 Handler FPM/FastCGI CGI/FastCGI
Apache evidence Loaded PHP module and embedded PHP handler rule proxy_fcgi_module plus a proxy target CGI/fcgid module and corresponding handler or executable rule
Process to restart after PHP worker/config changes Apache, because PHP is in its workers The relevant FPM service; Apache may also need a reload when its proxy configuration changes The CGI/fcgid service or Apache, depending on the implementation and changed setting
Apache MPM considerations PHP’s Apache guidance notes that non-thread-safe PHP builds require the prefork MPM Works with Apache’s event MPM because PHP is separate from Apache workers Depends on the CGI/fcgid implementation and its Apache integration
Site isolation PHP runs in Apache’s worker context Separate pools can use different users, limits, sockets, and PHP versions Isolation and process management vary by implementation
Where configuration is applied Apache’s PHP module and the web SAPI’s INI files Apache proxy rules plus each FPM pool and its PHP INI files Apache handler rules plus the CGI executable’s environment and configuration

The PHP manual recommends PHP-FPM with Apache’s mod_proxy_fcgi module for modern deployments. Apache’s documentation describes that method as preferred for Apache 2.4 and newer. Those recommendations explain why many current installations report FPM/FastCGI, but they do not change the need to verify the specific host you are administering.

Troubleshoot common contradictory results

php -v shows one version, but the site shows another

  • Confirm that the browser request reached the intended hostname and virtual host.
  • Read the web page’s Loaded Configuration File and Additional INI files parsed values.
  • Check which PHP module or FPM socket the active Apache configuration selects.
  • Use the web version for application compatibility decisions; use the CLI version only for shell, cron, or command-line tasks.

The page says FPM/FastCGI, but no FPM service appears

Check whether the service has a versioned name, whether the request is handled by another host or container, and whether Apache is forwarding to a different FastCGI implementation. Then inspect the active ProxyPassMatch or SetHandler target and compare it with the processes listening on that socket or port. The label establishes a FastCGI SAPI, not necessarily the package name of the process behind it.

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

The page says CGI/FastCGI, and you expected FPM

Look for mod_cgi, mod_cgid, fcgid rules, and extension-to-handler mappings. Verify that the active virtual host, rather than a disabled sample file, contains the dispatch rule. If there is no matching FPM pool and no FPM endpoint, report the site as CGI/FastCGI rather than calling it PHP-FPM.

The Apache module list and page disagree

Check for multiple Apache instances, a proxy or load balancer in front of the host, and virtual-host-specific configuration. The module list describes one Apache process; the URL may be reaching another listener or server. Repeat the test with a response path that unambiguously identifies the intended host, then inspect that host’s configuration.

The diagnostic URL returns a download, 404, or source code

  • A download or source-code response means PHP was not selected for that path; remove the file and correct the handler before exposing any application code.
  • A 404 usually means the file is not in the document root for that virtual host, or the URL selected another site.
  • A server error can indicate a missing module, unreachable FPM socket, incorrect socket permissions, or a syntax error in the dispatch configuration. Check Apache’s error log and the FPM service log while making a controlled correction.

Remove the diagnostic file immediately

Delete handler-check.php and any replacement page as soon as you have recorded the values. phpinfo() exposes configuration, environment details, HTTP headers, loaded modules, filesystem paths, and other information useful to an attacker. Do not protect it merely by leaving the obscure filename in place; remove it from the document root or deny access and then verify that the URL no longer responds.

A repeatable checklist

  1. Create a temporary phpinfo() page in the target virtual host’s document root.
  2. Request it through the application’s exact hostname, scheme, port, and path.
  3. Record Server API, PHP Version, configuration-file paths, and web-server information.
  4. Classify the first result as embedded Apache, FPM/FastCGI, or CGI/FastCGI.
  5. Run apachectl -M or apache2ctl -M and identify the relevant loaded module.
  6. Inspect the active virtual-host and included configuration for AddHandler, SetHandler, <FilesMatch>, and ProxyPassMatch.
  7. If FPM is indicated, check the running service and match its pool listen value to Apache’s socket or TCP target.
  8. Compare the web values with php -v and php --ini, treating the HTTP values as authoritative for the site.
  9. Delete the diagnostic file and confirm that it is no longer reachable.

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.

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.

Leave a Reply

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

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.