Troubleshooting and Quick Repair Tools in cPanel & WHM

This guide covers essential troubleshooting and quick-repair tools available in cPanel & WHM, including Autofixer, cloud-hosted hostname fixes, restoring database grants, using the scl utility for PHP management, and diagnosing Perl/CGI script issues.

Autofixer، scl

~2 min read · Updated Feb 18, 2026

1. Autofixer – Browser-Based Automatic Repair Tool


Autofixer is a collection of lightweight repair scripts that allow you to fix common cPanel & WHM issues directly from your browser without requiring SSH access.


How to Use Autofixer

  1. Open the following URL:
    https://serverip:2087/scripts2/autofixer
  2. Log in as root.
  3. Enter the Autofixer script name.
  4. Click Submit.
  5. The output will appear in your browser.

Available Autofixer Scripts (as of 2026)

Script Name Description Important Note
safesshrestart Repairs SSH configuration and restarts the SSH service Use only when SSH login is broken
test Test script – makes no changes Useful for verifying Autofixer functionality
update_gatherer_permissions Fixes permissions for Configuration Analytics Use when analytics features malfunction

Warning: Only run Autofixer scripts when instructed by cPanel Support. Misuse may cause system issues.




2. Cloud-Hosted Hostname Solution


On cloud servers (Google Cloud, AWS, Hetzner, etc.), dhclient may overwrite the server’s hostname. This causes:

  • Hostname resets
  • cPanel license failures
  • WHM → Change Hostname not working

Fix: dhclient Exit Hook

Create the following file:

/etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname

Contents:

#!/bin/sh
hostname server.yourdomain.com
/scripts/fixetchosts

Quick Create Command

mkdir -p /etc/dhcp/dhclient-exit-hooks.d/ && \
echo -ne '#!/bin/sh\nhostname server.yourdomain.com\n/scripts/fixetchosts\n' > /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname && \
chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname

Note: File permissions must be 0755.




3. Restore Database Grants


Sometimes a database user loses its GRANT permissions. This is a common issue and can be fixed using the restoregrants utility.


Restore Grants for a Specific Database User

/usr/local/cpanel/bin/restoregrants --cpuser=USERNAME --db=mysql --dbuser=DBUSER

Restore All Database Users for an Account

/usr/local/cpanel/bin/restoregrants --cpuser=USERNAME --db=mysql --all

If restoregrants Does Not Work

Reset the cPanel account password via WHM or cPanel. This often re-applies all GRANT permissions automatically.




4. scl Utility – Managing Multiple PHP Versions in EasyApache 4


EasyApache 4 uses the Software Collection Library (SCL) to run multiple PHP versions simultaneously (ea-php81, ea-php82, ea-php83).


Syntax

scl enable ea-php81 'php -m'
scl enable ea-php82 'php -v'
scl enable ea-php

Written & researched by Dr. Shahin Siami

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue