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:
- Go to aaPanel → App Store → find the PHP version the site uses → click Reload (restart PHP-FPM)
- Or via SSH:
systemctl restart php-fpm-81(replace81with your PHP version number, e.g.,74,80) - 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_limitin PHP settings - Nginx config syntax error: Run
nginx -tvia 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:
- Go to aaPanel → Website → your site → URL rewrite
- Select WordPress from the preset dropdown
- 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:
- Check the domain's A record:
dig yourdomain.com A +short-should return this server's IP - Confirm port 80 is open in the aaPanel firewall: Security → Firewall-port 80 should be listed
- 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":
- Verify
wp-config.phpcredentials: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST (127.0.0.1) - Confirm MySQL is running:
systemctl status mysql - Test connection:
mysql -u DB_USER -p - Check disk space:
df -h-a full disk stops MySQL - 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 restartor/etc/init.d/bt restart - Check panel status:
bt status - Recover panel URL if forgotten:
bt default
Where to find logs
| Log type | Location |
|---|---|
| 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
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.





















