Compiler access allows users on your server to compile C and C++ code via the command line. By default, compilers are disabled on cPanel & WHM servers for security reasons, as compiled programs can pose significant security risks. Enable this feature only if you have a legitimate need and understand the implications.
Step 1: Log in to WHM
Open your browser and navigate to https://your-server-ip:2087. Enter your root or reseller credentials to access the WHM dashboard.
Step 2: Navigate to Compiler Access
Use the left-hand sidebar to go to Home » Security Center » Compiler Access.
Step 3: Enable Compilers
Click the Enable Compilers button on the page.
Step 4: Save Changes
Click Save to apply the change.
Important Notes
- Security warning: Enabling compilers allows all shell users on the server to compile and execute arbitrary code. This significantly increases the attack surface of your server.
- Only enable compilers if you have a specific need, such as installing software that requires compilation from source.
- After you have finished compiling your software, it is strongly recommended to disable compilers again by returning to this page and clicking Disable Compilers.
- Compiler access affects tools such as
gcc,g++, andcc. - cPanel provides many server applications through its EasyApache and Software modules, which do not require manual compiler access.
Troubleshooting
- Users report "command not found" for gcc: Verify that compilers are enabled via WHM. Also check that the compiler packages are installed: run
yum install gcc gcc-c++(CentOS/CloudLinux) orapt install gcc g++(Ubuntu). - Cannot find Compiler Access: Ensure you are logged in as root. Resellers do not have access to Security Center settings.
- Compilers enabled but compilation fails: Check that the user has proper shell access (WHM » Account Functions » Manage Shell Access) and that the account is not in Jailed Shell mode, which restricts compiler access.