UnderHost
Knowledgebase Docs

aaPanel troubleshooting-common issues and fixes

Diagnose and fix 502 errors, sites not loading, SSL failures, PHP version issues, database connection problems,

On this page

Most aaPanel site issues fall into a handful of categories: PHP-FPM process problems, web server configuration errors, DNS propagation timing, PHP application errors, or database connectivity. Work through this guide from the top.

502 Bad Gateway

A 502 error means Nginx (or Apache) cannot get a response from PHP-FPM. The PHP service for the site has crashed or is not responding.

Fix:

  1. Go to aaPanel → App Store → find the PHP version the site uses → click Reload (restart PHP-FPM)
  2. Or via SSH: systemctl restart php-fpm-81 (replace 81 with your PHP version number, e.g., 74, 80)
  3. Check the PHP-FPM error log: tail -50 /www/server/php/81/var/log/php-fpm.log

Common causes: PHP process ran out of memory (OOM killed), a runaway script using all FPM workers, or a PHP syntax error after a code deployment.

500 Internal Server Error

A 500 error indicates a PHP application error or web server config problem. Check the site error log:

tail -100 /www/wwwlogs/yourdomain.com.error.log

Or from the aaPanel UI: Website → your site → Error log tab.

Common causes and fixes:

  • PHP fatal error in a plugin: Rename the plugin folder via FTP/File Manager to disable it
  • Memory limit exhausted: Increase memory_limit in PHP settings
  • Nginx config syntax error: Run nginx -t via SSH; fix the config error shown
  • Wrong file permissions: PHP files should be 644, directories 755. Not 777.

WordPress 404 errors on all pages except homepage

The WordPress URL rewrite rules are not applied. Fix:

  1. Go to aaPanel → Website → your site → URL rewrite
  2. Select WordPress from the preset dropdown
  3. Click Save

This applies the correct rewrite rules for Nginx or Apache. After saving, reload a non-homepage URL to confirm it works.

SSL not issuing

Let's Encrypt validation requires your domain to point to this server. Confirm:

  1. Check the domain's A record: dig yourdomain.com A +short-should return this server's IP
  2. Confirm port 80 is open in the aaPanel firewall: Security → Firewall-port 80 should be listed
  3. If using Cloudflare proxy (orange cloud), switch to DNS only (grey cloud) temporarily

If all the above are correct and SSL still fails, check the acme.sh log:

tail -50 /root/.acme.sh/acme.sh.log

Site not loading after a DNS change

DNS propagation takes time. To confirm the issue is propagation and not a config error:

  • Test directly via IP: curl -H "Host: yourdomain.com" http://YOUR.SERVER.IP/
  • If the site responds via IP but not the domain name, DNS has not propagated to your location yet-wait and retry
  • Check propagation globally: See DNS propagation explained for more detail

Database connection error

WordPress showing "Error establishing a database connection":

  1. Verify wp-config.php credentials: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST (127.0.0.1)
  2. Confirm MySQL is running: systemctl status mysql
  3. Test connection: mysql -u DB_USER -p
  4. Check disk space: df -h-a full disk stops MySQL
  5. Check MySQL error log: tail -50 /www/server/data/mysql-error.log

aaPanel panel not accessible

If the panel URL does not load:

  • Panel port blocked: SSH in and run ufw allow PORT/tcp && ufw reload (replace PORT with your panel port)
  • Panel service stopped: SSH in and run bt restart or /etc/init.d/bt restart
  • Check panel status: bt status
  • Recover panel URL if forgotten: bt default

Where to find logs

Log typeLocation
Nginx error log (per site)/www/wwwlogs/yourdomain.com.error.log
Nginx access log (per site)/www/wwwlogs/yourdomain.com.log
PHP-FPM log/www/server/php/81/var/log/php-fpm.log
MySQL error log/www/server/data/mysql-error.log
aaPanel panel log/www/server/panel/logs/request.log
aaPanel error log/www/server/panel/logs/error.log
Let's Encrypt log/root/.acme.sh/acme.sh.log

You can also view site error logs directly in the aaPanel UI: Website → click site name → Error log tab.

Related: How to change PHP version in aaPanel | SSL certificates in aaPanel | Configure firewall rules in aaPanel | How to monitor server resources in aaPanel | Fix 500 Internal Server Error | Database connection error

Was this article helpful?

Need aaPanel hosting?

Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.

Related articles

Back to aaPanel