I am having problems with a script I wrote

Scripts | Updated 2026

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.

First Step: Check the Error Log

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_log file 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);
Remove Debug Code Before Going Live

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)
Permission Rule

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. Use mysqli_* or PDO instead
  • each() function was removed in PHP 8.0
  • Implicit nullable parameters cause deprecation warnings in PHP 8.4+
  • Short open tags (<? without php) 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. Check which extensions are enabled in cPanel > Select PHP Version
  • 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 PHP Selector 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 Ticket

Quick Recap: Script Troubleshooting

  1. Check the error log in cPanel > Metrics > Errors first
  2. Verify permissions are 644 for files, 755 for directories
  3. Check PHP version compatibility in cPanel > Select PHP Version
  4. Fix file paths to match your hosting account structure
  5. Review restrictions if your script needs functions not available on shared hosting

11,872 users found this article useful · Last updated March 2026 · Browse all PHP/MySQL articles

  • 592 Users Found This Useful

Was this answer helpful?

Related Articles

How can I view/modify data in my MySQL database?

PHP/MySQL | Updated 2026 phpMyAdmin is the primary tool for viewing, editing, and managing...

How to Add a User to a MariaDB/MySQL Database

PHP/MariaDB/MySQL | Updated March 2026 Every application that uses a database (WordPress,...

What is the Path to ImageMagick?

PHP/MySQL | Updated 2026 ImageMagick is installed on all Ultra Web Hosting servers and is...

What Port is MariaDB/MySQL On?

PHP/MariaDB/MySQL | Updated 2026 MariaDB/MySQL runs on port 3306 by default on all Ultra Web...

How do I import into a MariaDB - MySQL database?

PHP/MySQL | Updated 2026 Importing data into a MariaDB or MySQL database on your hosting...



Save 30% on web hosting - Use coupon code Hosting30