If a script you wrote or installed is not working on your hosting account, this guide walks you through the most common causes and how to fix them. These steps apply to PHP, Perl, Python, and other server-side scripts on Ultra Web Hosting.
Before anything else, check your error log in cPanel > Metrics > Errors. The error message will tell you exactly what line of code is failing and why. Most script problems can be diagnosed from the error log in under a minute.
01. Check Your Error Logs
Your hosting account has two error logs you should check:
- cPanel Error Log - go to cPanel > Metrics > Errors. Shows the most recent PHP, Perl, and CGI errors
- Raw error_log file - PHP errors are also written to an
error_logfile in the same directory as your script. Check via File Manager or FTP
If errors are not appearing, you may need to enable error logging. Add this to the top of your PHP script for debugging:
ini_set('display_errors', 1);
ini_set('log_errors', 1);
error_reporting(E_ALL);
Displaying errors on a production website exposes file paths and database details that attackers can exploit. Use display_errors only during development. On production, set display_errors = Off and rely on log_errors instead.
02. File Permissions
Incorrect permissions are one of the most common causes of script failures:
- PHP files: 644 (owner read/write, group and world read)
- Directories: 755 (owner full, group and world read/execute)
- CGI/Perl scripts: 755 (must be executable)
- Configuration files with passwords: 600 or 640 (restrict access)
On our CloudLinux servers, never set files to 777. The server is configured to reject files with world-writable permissions as a security measure. If a tutorial tells you to use 777, use 755 for directories and 644 for files instead.
03. PHP Version Compatibility
If your script was written for an older PHP version, it may fail on newer versions due to removed functions or changed behavior. Common issues:
- mysql_* functions (e.g.,
mysql_connect) were removed in PHP 7.0. Usemysqli_*or PDO instead - each() function was removed in PHP 8.0
- Implicit nullable parameters cause deprecation warnings in PHP 8.4+
- Short open tags (
<?withoutphp) may be disabled
You can change your PHP version in cPanel. See How to Change Your PHP Version.
04. File Paths and Includes
Hardcoded paths from another server will not work here. Common path issues:
- Document root:
/home/username/public_html/ - Use absolute paths in includes:
include('/home/username/public_html/config.php'); - Or use relative paths with
__DIR__:include(__DIR__ . '/config.php');
For the full list of server paths, see Server Paths - PHP, Perl, Python, and More.
05. Common Script Errors
- 500 Internal Server Error - syntax error, wrong permissions, or .htaccess conflict. See Error 500 guide
- 403 Forbidden - wrong permissions or mod_security blocking. See 403 error guide
- Blank white page - PHP fatal error with display_errors turned off. Check the error log
- "Class not found" or "Function undefined" - missing PHP extension. Most are enabled by default; if one you need is missing, open a support ticket and we'll enable it
- open_basedir restriction - your script is trying to read files outside your home directory. See open_basedir fix
- Form not sending email - see Why Does My Form Not Send Email
06. Shared Hosting Restrictions
Shared hosting has certain restrictions to protect all users on the server:
- exec(), system(), passthru() are disabled. See disabled functions guide
- Memory limit: 384MB per PHP process
- Max execution time: 120 seconds default
- File upload size: configurable via MultiPHP INI Editor or .htaccess
- No root access - you cannot install system packages or modify server configuration
If your script needs more resources, consider upgrading to a VPS or dedicated server.
Still Stuck?
If you have checked the error log and tried the steps above, open a support ticket with the exact error message and we will help you diagnose the issue.
Open a Support TicketFrequently Asked Questions
How do I debug a script that is not working?
Check the error log first. In cPanel open Metrics then Errors, or read the error_log file in the script's directory. The last entries name the exact error, so you fix the real cause instead of guessing. This applies to PHP, Perl, and Python scripts.
Why does my script return a 500 error?
Common causes are a syntax or fatal error in the code, wrong file permissions, an unsupported PHP version, or a bad include path. The error_log pinpoints which. Scripts usually need 644 permissions and CGI scripts 755.
Could the PHP version be breaking my script?
Yes. Older code can fail on a newer PHP version and vice versa. Set the PHP version your script needs in cPanel under Select PHP Version, then test. Many script errors after a move trace back to a PHP version mismatch.
Why does my script work elsewhere but not on shared hosting?
Shared hosting disables risky functions like exec and system and restricts file access to your account via open_basedir. A script that shells out or reaches outside its directory will fail here. Rework it to stay within your account, or use a VPS for full control.
Quick Recap: Script Troubleshooting
- Check the error log in cPanel > Metrics > Errors first
- Verify permissions are 644 for files, 755 for directories
- Check PHP version compatibility in cPanel > MultiPHP Manager
- Fix file paths to match your hosting account structure
- Review restrictions if your script needs functions not available on shared hosting
11,872 users found this article useful · Last updated November 2026 · Browse all PHP/MySQL articles
