How to fix WHMCS to cPanel/WHM Login Issue: 415 Unsupported Media Type Explained
Are you facing the following error when trying to access WHM or cPanel from WHMCS?
“415 Unsupported Media Type”
Error: <html> <head><title>415 Unsupported Media Type</title></head> <body> <center><h1>415 Unsupported Media Type</h1></center> <hr><center>openresty/1.27.1.1</center> </body> </html>
This issue commonly occurs due to changes in how cPanel/WHM handles API requests or due to a mismatch in content-type headers in the communication between WHMCS and the server.
π Causes:
- Your server is likely running cPanel v118+ where stricter content-type validation is enforced.
- WHMCS may be using an outdated or incompatible method for API calls.
- Missing or incorrect
Content-Type: application/json
headers in API requests.
β Solutions:
1. Update WHMCS
Ensure you’re running the latest version of WHMCS, as newer versions include compatibility fixes for updated cPanel APIs.
2. Check API Integration Settings
If you’re using custom modules or integrations, verify they are sending Content-Type: application/json
in their headers when making requests to cPanel/WHM.
3. Server Configuration
Some web servers or firewalls (e.g., ModSecurity, CSF) might interfere with API calls. Check logs and temporarily disable them for testing.
4. Contact Support
If everything seems fine and the issue persists, itβs best to contact WHMCS or your hosting provider for deeper investigation.
β Other Solutions:
We can solve this issue by adding your WHMCS IP to your server.
To add WHMCS IP to your server please follow setps.
imunify360-agent ip-list local add --purpose white ip_of_whmcs