AdminsForum
Fix: 502 Bad Gateway after switching a site's PHP version in aaPanel Posted by: JAY - 10-06-2026, 12:15 PM - Forum: aaPanel - No Replies

How do you fix a 502 after changing PHP version in aaPanel?
Check the site's Nginx error log, confirm its selected PHP version, and verify that the matching PHP-FPM service is healthy and listening where Nginx expects it. Restore the last working selection if necessary and application-compatible. A 502 alone does not identify the cause.

Scope and review: Documentation reviewed 9 October 2026. This covers Nginx with panel-managed PHP-FPM after a PHP-version change, not every 502 or an OpenLiteSpeed/Apache deployment. Fresh-VPS reproduction and screenshots are pending. Record aaPanel, OS, Nginx and PHP versions. PHP 8.3 and example.com below are placeholders.

1. Correlate the failure with the site's error log
Confirm the actual log path in aaPanel and reproduce one failing request:

Code:
sudo tail -n 50 /www/wwwlogs/example.com.error.log
If the log reports:
Code:
connect() to unix:/tmp/php-cgi-83.sock failed (2: No such file or directory)
Nginx cannot find that configured Unix endpoint. The selected service may be stopped, may have failed to start, or may listen somewhere else. Confirm both sides before changing configuration.

Different messages need different checks:
  • Permission denied: inspect socket ownership/mode and security-policy denials; do not use chmod 777 or disable security globally.
  • Connection refused: check whether the configured listener is active.
  • Upstream timed out: investigate slow application/database work and resource pressure; do not blindly increase timeouts.

2. Check the selected PHP service
Prefer the panel's PHP service controls. If this installation uses the documented init script, an example status check is:
Code:
sudo /etc/init.d/php-fpm-83 status ls -l /tmp/php-cgi-83.sock
A socket file alone is not proof of a healthy service. Compare the site's upstream with PHP-FPM's configured listen endpoint. Do not create the socket yourself or change the application's PHP version without compatibility checks.

3. Inspect startup/configuration errors
A configuration check for this example installation:
Code:
sudo /www/server/php/83/sbin/php-fpm -t
If validation fails, read the reported file and setting. Possible causes include invalid configuration or an incompatible/missing extension. Install only extensions required by the application for the selected PHP version; do not disable arbitrary extensions or security controls as a shortcut. After correcting the cause, start the affected service through the panel. If using the matching init script:
Code:
sudo /etc/init.d/php-fpm-83 start
Changes to a shared PHP service can affect other sites using it.

4. Validate Nginx only if its configuration changed
Use the panel-managed binary on this example installation:
Code:
sudo /www/server/nginx/sbin/nginx -t
Do not reload if validation fails. If validation passes and the configuration was deliberately changed, use the supported panel reload control. Restoring PHP-FPM alone may resolve the failure without changing Nginx.

5. Verify recovery and keep a rollback path
  • The selected PHP service stays running and the expected listener is active.
  • A real PHP/application route loads, not just a static HTML page.
  • A new request produces no matching upstream error.
  • Other sites using that PHP version still work.
  • Required extensions and application/database operations are checked.
If a live site remains down after a version switch, consider restoring its previous working PHP selection through the panel while diagnosing, provided the application still supports it. Back up settings before further changes.

For help: Share the version details, selected PHP version, time of failure and a few redacted error lines. Do not share credentials, tokens or a full configuration dump.

Official references: aaPanel PHP selection and logs; Nginx FastCGI upstreams; PHP-FPM configuration.

Related: aaPanel file and log locations · Setup checklist.

Welcome to AdminsForum: what this community is about Posted by: JAY - 10-06-2026, 12:15 PM - Forum: Announcements and rules - No Replies

AdminsForum is a community for people who run servers and hosting: sysadmins, developers, freelancers, small hosting companies and anyone managing their own VPS.

What we focus on

  • Free & open-source control panels: aaPanel, CyberPanel, FASTPANEL, HestiaCP and CloudPanel, plus Webmin, Virtualmin, ISPConfig and others. These panels are popular, but their help is scattered across GitHub issues, old threads and translated docs. We want one place where the fixes live.
  • Servers and infrastructure: Linux administration, Nginx, Apache and OpenLiteSpeed, email servers, networking and DNS.
  • Security and performance: hardening, malware cleanup, PHP-FPM and database tuning, caching and backups.

How to get a fast answer
  1. Search first. The search box at the top of every page covers all threads, so try your exact error message.
  2. Post in the section for your panel or service.
  3. Include your panel, OS, web server and PHP versions, and paste logs in [code] tags with passwords and IPs removed.
Please read the rules and posting guide before your first post.

New here?
Say hello in Introductions and tell us what you run. Ideas for the forum itself go in Feedback and suggestions.

Hi, I'm Jay, founder of AdminsForum Posted by: JAY - 10-06-2026, 12:15 PM - Forum: Introductions - No Replies

Hi everyone, I'm Jay Dev, the founder of AdminsForum.

A bit about me
I've been building and running websites and the servers behind them since 2013, as a developer and as the person who gets the call when something breaks.

Over the years I've worked with many hosting control panels, both free and commercial, and I don't push any one of them. Each panel has its strengths, and the right choice depends on your server and your sites. Like most admins, I've chased my share of 502 Bad Gateway errors, PHP-FPM problems, broken SSL renewals and mail that suddenly stopped delivering.

Why I started AdminsForum
Help for free hosting control panels is scattered across GitHub issues, old forum threads and machine-translated docs. Too often the answer you need is half-finished, out of date or written for a different version.

I wanted one place where server admins can ask, answer and keep the fixes searchable, covering every major hosting control panel, free and commercial: aaPanel, CloudPanel, CyberPanel, FASTPANEL, HestiaCP, cPanel, Plesk and more. Our comparisons stay neutral, so you can pick the panel that fits your needs.

How we create our guides

  • Tested on real servers. We run dedicated lab servers just for testing. Every step is done on a fresh install of the panel, and the screenshots come from those servers.
  • Sources checked. Versions, requirements and commands are checked against each panel's official documentation, with links at the end of each guide.
  • Kept up to date. Panels change often, so each guide states the version it was tested on and gets updated when things change.
  • Video lessons too. Our step-by-step courses are on the AdminsForum YouTube channel and collected in the AdminsForum Academy, each linked to its written guide.

Getting help here
Post your question in the Support & Troubleshooting forum for your panel. Include your panel version, OS and web server, the exact error message, and what you've already tried; it makes a quick answer much more likely.

Say hello
If you run a VPS, manage client sites or work at a hosting company, you're in the right place. Reply here and tell us:
  • What you run (panel, OS, web server)
  • What you're working on or struggling with right now
  • Which guides you'd like to see next
Before posting, please read the rules and posting guide. Ideas for the forum are welcome in What would you like to see on AdminsForum?

Welcome aboard!
Jay

AdminsForum rules and posting guide Posted by: JAY - 10-04-2026, 01:32 PM - Forum: Announcements and rules - Replies (1)

Welcome! Please read this before you post.

AdminsForum is a community for people who run servers and hosting panels. These rules keep it useful, friendly and safe for everyone.

1. Be respectful
Everyone here was a beginner once. Disagree with ideas, not people. No insults, harassment, hate speech or personal attacks.

2. No spam or advertising
No unsolicited ads, affiliate links, link drops or SEO posts. Mentioning a tool or provider that genuinely answers someone's question is fine.

3. Legal and ethical only
No pirated software, cracked or nulled panels, scripts or licences. No help attacking, scanning or breaking into servers you don't own or manage. Security discussion is welcome when it's about protecting your own systems.

4. Protect your own data
Before posting logs or configs, remove passwords, API keys, database credentials, email addresses, and any IPs or domains you want to keep private. Moderators may edit posts that expose sensitive data.

5. One topic per thread, clear titles
Use a title that describes the problem, ideally with the error message, for example "aaPanel: 502 Bad Gateway after switching to PHP 8.3" rather than "Help!!!". Post in the section that fits your panel or topic, and don't post the same question in several forums.

6. Give back
When a reply fixes your problem, say so and thank the person who helped. If you solve it yourself, post what worked. The next person with the same problem will thank you.

7. No necro-bumping
Don't revive old threads just to say "same problem". Start a new thread and link to the old one.

How to ask a good question

  • Your panel and its version (aaPanel 7, CyberPanel 2.3, HestiaCP 1.8 and so on)
  • Your OS and version (Ubuntu 24.04, Debian 12, AlmaLinux 9 and so on)
  • Your web server and PHP version
  • What you changed right before the problem started
  • The exact error message and the relevant log lines, pasted in a code block (the # button in the editor)
  • What you've already tried

A log pasted in a code block looks like this:
Code:
2026/10/03 09:02:11 [crit] 2231#0: connect() to unix:/tmp/php-cgi-83.sock failed (2: No such file or directory)

Reporting
If you see a post that breaks these rules, use the Report button under it instead of replying. Moderators may edit, move or remove posts and issue warnings. Repeated or serious breaches lead to a ban.

Thanks for helping build a useful place for admins.
JAY

Welcome, Guest
You have to register before you can post on our site.
Forum Statistics
4Members:
174Threads
181Posts
Latest member: MAYA
Full Statistics
Latest Threads
DEV
Fix 504 Gateway Timeout E...

Forum: aaPanel Websites & Web Servers Guides, Last Post: DEV
4 minutes ago
DEV
Fix 413 Request Entity To...

Forum: aaPanel Websites & Web Servers Guides, Last Post: DEV
54 minutes ago
DEV
Fix 403 Forbidden Errors ...

Forum: aaPanel Websites & Web Servers Guides, Last Post: DEV
Yesterday, 01:18 PM
DEV
Fix PHP HTTP 500 Errors i...

Forum: aaPanel PHP & Extensions Guides, Last Post: DEV
Yesterday, 01:11 PM
JAY
CloudPanel Backups and Se...

Forum: CloudPanel Security Guides, Last Post: JAY
Yesterday, 01:10 PM
JAY
CloudPanel Cron Jobs, Log...

Forum: CloudPanel Varnish Cache & Performance Guides, Last Post: JAY
Yesterday, 01:10 PM
JAY
CloudPanel SSH, SFTP, FTP...

Forum: CloudPanel Users, SSH & SFTP Guides, Last Post: JAY
Yesterday, 01:09 PM
JAY
CloudPanel Databases: Cre...

Forum: CloudPanel Databases & phpMyAdmin Guides, Last Post: JAY
Yesterday, 01:09 PM
DEV
Monitor Server Resources ...

Forum: aaPanel Websites & Web Servers Guides, Last Post: DEV
Yesterday, 12:51 PM
DEV
Check Website Logs in aaP...

Forum: aaPanel Websites & Web Servers Guides, Last Post: DEV
Yesterday, 12:48 PM
Online Users
There are currently 21 online users.
1 Member(s) | 18 Guest(s)

Bing, Google, DEV