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
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Yes: one Apache server can run different PHP versions for different websites at the same time. The reliable design is to run a separate PHP-FPM service, with at least one pool and one endpoint, for each PHP version. Apache then routes each virtual host’s .php requests to the intended Unix socket or local TCP listener.
PHP-FPM does not select a version by itself and does not understand Apache virtual hosts. Apache must choose the backend and provide the correct script path. The sections below show how to install the services, map each site, verify the result, and avoid the connection, permissions, and worker-capacity problems that make every site appear to use one PHP version.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchHow the multi-version design works
Think of the setup as three layers:
- PHP-FPM services: one service process for each installed PHP branch, such as PHP 8.2-FPM and PHP 8.3-FPM. Each service can have one or more pools.
- Endpoints: every pool listens on a distinct Unix-domain socket or TCP port. A versioned socket such as
/run/php/php8.2-fpm.sockmust not be confused with the socket for another version. - Apache virtual hosts: each site’s
<VirtualHost>contains a handler that forwards PHP requests to the matching endpoint.
When a request for site82.example arrives, Apache matches that hostname, sees its PHP handler, and sends the script to the PHP-FPM endpoint assigned to that host. A request for site83.example follows the same process but uses the other service. Static files continue to be served directly by Apache.
PHP-FPM is a FastCGI process manager. It does not know which Apache virtual host, alias, or document root caused a request. Apache supplies that context, including the script filename, so the handler belongs in the virtual host that owns the application.
#1 Best Overall
- 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.
Plan the versions, sites, and endpoints first
Write down the mapping before changing configuration. This prevents a global handler from silently taking precedence over a per-site rule.
| Site | PHP version | FPM service and pool | Example endpoint |
|---|---|---|---|
site82.example |
PHP 8.2 | php8.2-fpm, site82 pool |
Unix socket /run/php/php8.2-fpm-site82.sock |
site83.example |
PHP 8.3 | php8.3-fpm, site83 pool |
Unix socket /run/php/php8.3-fpm-site83.sock |
The version numbers above are examples, not a promise that those branches are available in your distribution release. Package repositories, supported PHP branches, service names, and socket paths change between operating-system releases. Confirm the versions your chosen distribution supports before installing.
Decide whether you need separate pools
A separate FPM service is required for each PHP version. Within a version, you can use one pool for several sites or create a pool per site. Per-site pools provide clearer process limits, Unix-user ownership, socket permissions, and filesystem boundaries, at the cost of more configuration and monitoring. If sites are unrelated or have different trust levels, separate pools are usually easier to secure and tune.
Install a matching FPM service for every PHP version
Install the core PHP packages and the matching FPM package for each version. Use the package manager and repository appropriate to the operating-system release; do not assume a package name from another distribution.
Illustrative Debian or Ubuntu-style commands
The following is an example for a system whose repositories expose PHP 8.2 and 8.3 packages. Replace the versions with branches that are actually available on your host.
sudo apt update
sudo apt install php8.2-fpm php8.3-fpm
sudo systemctl enable --now php8.2-fpm
sudo systemctl enable --now php8.3-fpm
On another release, the package names may differ, the service may be named differently, or one of the branches may require an additional repository. Treat the commands as a pattern, not a universal copy-and-paste recipe.
Check that every service is listening
Inspect service status and the FPM pool configuration after installation.
Rank #2
- 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
systemctl status php8.2-fpm
systemctl status php8.3-fpm
ss -lx | grep php
ss -ltn | grep 127.0.0.1
Look for a distinct socket or local port for each pool. If a service is active but no endpoint exists, inspect that version’s FPM error log and pool configuration before configuring Apache.
Configure distinct FPM pools and sockets
Each FPM pool has a listen setting. A simple arrangement is one socket per PHP version; a more isolated arrangement is one socket per site.
Version-specific sockets
A pool for PHP 8.2 might listen on /run/php/php8.2-fpm.sock, while PHP 8.3 listens on /run/php/php8.3-fpm.sock. The exact pool file location varies by distribution. Ensure the socket directory exists at boot and that the FPM service recreates the socket after a restart.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Per-site sockets
For stronger boundaries, use names such as:
/run/php/php8.2-fpm-site82.sock
/run/php/php8.3-fpm-site83.sock
Set the pool’s Unix user and group to the account that should execute that application’s PHP code. Set socket ownership and mode so Apache can connect without granting access to unrelated users. The pool user also needs the filesystem permissions required by the application, but it should not receive write access to the entire server.
TCP listeners
A pool can listen on a local address and port instead of a Unix socket, for example 127.0.0.1:9082 and 127.0.0.1:9083. Use a different port for every pool. Bind to loopback unless a deliberately isolated container or network namespace needs another address. A FastCGI listener exposed on a public interface can allow unintended clients to reach the backend.
Enable Apache’s FastCGI proxy support
Apache forwards requests to PHP-FPM through mod_proxy_fcgi. Enable the base proxy module, the FastCGI provider, and any environment module required by your distribution.
sudo a2enmod proxy
sudo a2enmod proxy_fcgi
sudo a2enmod setenvif
sudo apachectl configtest
sudo systemctl reload apache2
The module-enabling command is specific to Debian-family packaging. On other systems, load the equivalent modules in Apache’s module configuration. A successful syntax check is necessary before a reload, but it does not prove that the socket exists or that Apache has permission to use it.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- 【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.
Route each virtual host to its PHP-FPM endpoint
Keep the handler inside the virtual host for the site. Do not rely on a single globally enabled PHP handler if different sites need different versions.
Unix-socket configuration with SetHandler
This example sends PHP files for one host to the PHP 8.2 socket:
<VirtualHost *:80>
ServerName site82.example
DocumentRoot /var/www/site82/public
<Directory /var/www/site82/public>
Require all granted
AllowOverride All
</Directory>
<FilesMatch ".php$">
SetHandler "proxy:unix:/run/php/php8.2-fpm-site82.sock|fcgi://localhost/"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/site82-error.log
CustomLog ${APACHE_LOG_DIR}/site82-access.log combined
</VirtualHost>
The corresponding PHP 8.3 host differs in the hostname, document root, and socket:
<VirtualHost *:80>
ServerName site83.example
DocumentRoot /var/www/site83/public
<Directory /var/www/site83/public>
Require all granted
AllowOverride All
</Directory>
<FilesMatch ".php$">
SetHandler "proxy:unix:/run/php/php8.3-fpm-site83.sock|fcgi://localhost/"
</FilesMatch>
ErrorLog ${APACHE_LOG_DIR}/site83-error.log
CustomLog ${APACHE_LOG_DIR}/site83-access.log combined
</VirtualHost>
The proxy:unix: syntax identifies the Unix socket; the part after the vertical bar identifies the FastCGI backend. Apache’s proxy-FCGI documentation supports this form. Keep the socket path exactly synchronized with the FPM pool’s listen value.
TCP configuration
If the PHP 8.2 pool listens on 127.0.0.1:9082, the handler can use a TCP backend:
<FilesMatch ".php$">
SetHandler "proxy:fcgi://127.0.0.1:9082"
</FilesMatch>
Use the corresponding port for the other host. TCP can be convenient when FPM runs in a separate container or network namespace, while a Unix socket avoids a local network hop and is a natural same-host default.
ProxyPassMatch as an alternative
Some configurations use ProxyPassMatch instead of SetHandler. A conceptual Unix-socket rule is:
Rank #4
- 【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.
ProxyPassMatch "^/(.*.php)$" "unix:/run/php/php8.2-fpm-site82.sock|fcgi://localhost/var/www/site82/public/$1"
Path handling is the important difference between seemingly similar rules. The backend must receive the real script filename, including the document-root prefix. If it receives only a URL path, PHP-FPM may report a missing script or Apache may return the source file instead of executing it. Test the exact path behavior on your Apache version and distribution before deploying the rule.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Prevent a global handler from overriding the site mapping
A common reason every site reports one PHP version is an old, globally enabled PHP configuration. Search Apache’s loaded configuration for a distribution-wide FPM handler, a global SetHandler, or a ProxyPassMatch rule that catches all virtual hosts. Disable or narrow that rule, then leave the intended mapping in each site’s <VirtualHost>.
Also check the order and scope of configuration files. A handler in a broad <Directory> block, an included fragment, or a default virtual host can affect requests that you expected the site-specific block to handle. Use Apache’s configuration-dump tools for your platform to confirm which virtual host is selected and inspect the effective configuration rather than relying only on the file you edited.
Verify the selected PHP version safely
- Run Apache’s syntax check, then reload only after it succeeds:
sudo apachectl configtest sudo systemctl reload apache2 - Create a temporary diagnostic file in each site’s document root. For example:
<?php phpinfo(); - Open the diagnostic page through the correct hostname, not by browsing the file from another virtual host. Confirm the PHP version, “Server API” or SAPI showing FPM/FastCGI, loaded configuration file, extension list, and the reported document root.
- Request a small version endpoint from a controlled, access-restricted location if the site is reachable by others. A diagnostic page exposes paths, environment data, and enabled modules.
- Delete the diagnostic file immediately after verification and clear any cache that could retain its output.
Test both hosts in separate browser windows or with a command-line HTTP client that sends the correct Host header. A successful page response alone is not proof that the intended PHP branch handled it; the version and FPM SAPI must be checked.
Unix sockets versus TCP listeners
| Decision axis | Unix socket | TCP listener |
|---|---|---|
| Typical use | Same-host Apache and FPM | Containers, network namespaces, or intentionally separated services |
| Endpoint | Filesystem path such as /run/php/php8.2-fpm.sock |
Address and port such as 127.0.0.1:9082 |
| Main operational concern | Socket ownership, group, mode, and recreation after reboot | Correct bind address, port reachability, and network access controls |
| Security boundary | Filesystem permissions can restrict which processes connect | Firewall and listener binding must prevent unintended clients |
| Isolation | Natural for services on one host | Useful when FPM is isolated from Apache’s filesystem or namespace |
| Monitoring cost | Check service state and socket existence | Check service state, listening port, and network path |
Neither transport automatically fixes a misrouted virtual host. The decisive control is still the Apache handler placed in the correct host configuration.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsSize Apache and FPM together
PHP-FPM workers use a prefork model: each worker handles one connection at a time. Apache documents that, with threaded MPMs and connection reuse, proxy connection pools can grow toward the number of Apache workers. If many persistent but idle connections occupy all FPM workers, new PHP requests can wait and eventually time out.
Set each pool’s pm.max_children with the Apache worker and connection limits in mind. A large Apache concurrency limit does not create more PHP capacity; it can instead send more simultaneous work toward a pool that has too few children. Conversely, increasing FPM children without enough memory can force swapping or out-of-memory termination.
Best Value
- 【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.
A practical sizing sequence
- Measure the memory footprint of a worker for each PHP version and application under representative traffic.
- Reserve memory for Apache, the operating system, databases, queues, and filesystem cache.
- Divide the memory available to a pool by its observed worker footprint to establish a safe upper bound for
pm.max_children. - Compare the total children across all pools with Apache’s worker and connection settings. Avoid allowing Apache to maintain a large number of backend connections that FPM cannot serve.
- Watch Apache and FPM error logs during realistic load. Look for backend timeouts, max-children warnings, refused connections, and queue growth before raising limits.
Apply these calculations separately to each PHP version because extensions and applications can produce different worker memory usage.
Troubleshoot the common failure modes
| Symptom | Likely cause | Checks and corrective action |
|---|---|---|
| 503 response or connection error | FPM service stopped, missing endpoint, or denied socket access | Check the matching service status, confirm the socket or port exists, verify the Apache runtime user can connect, and inspect both Apache and FPM logs. |
| Every site reports the same PHP version | Global handler or distribution-wide FPM include catches all hosts | Find and remove or narrow the global rule. Keep one explicit handler in each intended virtual host and verify the selected host name. |
| PHP source downloads or appears as plain text | mod_proxy_fcgi is not loaded, or no PHP handler matches |
Check loaded modules, the FilesMatch pattern, virtual-host selection, and Apache’s effective configuration. Reload after a successful syntax check. |
| “Primary script unknown” or wrong script path | The FastCGI backend received a URL path instead of the full filesystem path | Review the SetHandler or ProxyPassMatch path semantics, document root, aliases, and SCRIPT_FILENAME behavior. Confirm that the file exists from the FPM pool’s filesystem view. |
| Socket exists but Apache cannot connect | Socket owner, group, or mode excludes Apache | Inspect permissions, pool socket settings, and the account Apache uses. Restart the matching FPM service if the socket was recreated with stale ownership. |
| Application fails after switching versions | Different php.ini files or extension sets |
Use the diagnostic page or CLI tools for the specific FPM version, install and configure required extensions for that runtime, and retest the application. |
| Intermittent timeouts under load | FPM workers exhausted or Apache connection reuse outpaces pool capacity | Check FPM max-children messages and Apache timeout errors. Tune pool children and Apache worker limits together, considering available memory. |
Keep CLI PHP and web PHP straight
The PHP executable used in a shell is not automatically the PHP-FPM backend used by Apache. A command such as php -v reports the CLI binary selected by your system’s alternatives or path, while a browser request reports the FPM version assigned by the virtual host. Use the browser-side diagnostic endpoint to verify production routing, and select the intended CLI binary explicitly when running migrations, queue workers, or scheduled jobs.
This distinction matters during upgrades: changing the default CLI alternative does not necessarily change any Apache virtual host, and changing an FPM socket does not change a cron job that invokes another PHP binary.
Plan upgrades and package maintenance
Keep old and new FPM services running concurrently while you test an application on a new branch. Create a new pool and endpoint, point a staging or maintenance virtual host at it, and verify extensions, configuration values, file permissions, scheduled tasks, and background workers. Switch the production handler only after the application has passed those checks.
Package upgrades can change service unit names, default pool files, socket paths, or extension availability. After an operating-system or PHP upgrade, re-check the service status, endpoint path, Apache syntax, and version diagnostic for every host. Remove an obsolete pool only after no virtual host, job, or monitoring check still references it.
Deployment checklist
- Each required PHP branch is available from a repository appropriate to the operating-system release.
- A matching FPM service is installed, enabled, and running for every branch.
- Every pool has a distinct socket or TCP port.
- Socket ownership and mode allow Apache access without granting unnecessary users access.
- Apache’s proxy and FastCGI modules are loaded.
- Each virtual host has its own PHP handler pointing to the intended endpoint.
- No global handler overrides the per-host mapping.
- The FastCGI rule supplies the correct document-root path and script filename.
- Apache passes its syntax check before every reload.
- A temporary, access-controlled version check confirms the expected PHP version and FPM SAPI for every site.
- Diagnostic files are removed after testing.
- FPM worker limits and Apache concurrency are sized together and observed in logs.
- Each PHP version has the extensions and configuration its application requires.
What the final arrangement should look like
At the end, Apache remains one web server, but it has explicit per-host routing. The PHP 8.2 site points to the PHP 8.2-FPM endpoint, the PHP 8.3 site points to the PHP 8.3-FPM endpoint, and neither relies on a global default. Services, sockets, permissions, script paths, extensions, and worker limits are all checked independently. That explicit mapping is what allows multiple PHP versions to coexist predictably on one machine.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →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.

