🌐

Hestia CP

1 notes  •  Web Hosting

Fix Internal Server Errors in HestiaCP

Troubleshooting internal server errors (HTTP 500) on sites hosted in HestiaCP.

Step 1 — Check the Error Log

# Web error log (Apache)
cat /var/log/apache2/domains/example.com.error.log

# Nginx error log
cat /var/log/nginx/domains/example.com.error.log

# PHP-FPM error log
cat /var/log/php/error.log

Step 2 — Check File Permissions

# Web root should be owned by the site user
ls -la /home/username/web/example.com/public_html/

# Fix permissions
chown -R username:username /home/username/web/example.com/public_html/
find /home/username/web/example.com/public_html/ -type d -exec chmod 755 {} \;
find /home/username/web/example.com/public_html/ -type f -exec chmod 644 {} \;

Step 3 — Check PHP Version

# List available PHP versions
ls /etc/php/

# Check active PHP version for a domain in HestiaCP
# Go to: HestiaCP Admin → Web → Edit Domain → PHP Version

# Restart PHP-FPM
systemctl restart php7.4-fpm
systemctl restart php8.1-fpm

Step 4 — Check .htaccess (Apache)

# Temporarily rename .htaccess to test if it's the cause
mv /home/username/web/example.com/public_html/.htaccess    /home/username/web/example.com/public_html/.htaccess.bak

# Reload Apache
systemctl reload apache2

Step 5 — Restart Services

systemctl restart apache2
systemctl restart nginx
systemctl restart php8.1-fpm