How to Install a CodeCanyon PHP Script on Shared Hosting

by Fahim Mahmud Chisti

To install a CodeCanyon PHP script on shared hosting, you need five things right: the PHP version and extensions, a database, the document root, writable folders and the cron job. A blank page, a 500 Internal Server Error or an installer complaining about permissions almost always traces back to one of them. By the end of this guide the installer runs cleanly and the script’s background jobs fire on schedule.

Quick answer: Match the server to the script’s requirements first, then upload it so only its public/ folder is visible to the web.

  1. Select the PHP version the item requires and enable its extensions.
  2. Create a MySQL database and a user with all privileges.
  3. Upload and extract the files, and point the domain at the script’s public/ folder.
  4. Fill in .env or run the web installer, then make storage and bootstrap/cache writable.
  5. Add the cron job the script needs, using the PHP binary for your selected version.
In this guide
  1. Before You Start
  2. Why CodeCanyon Scripts Fail on Shared Hosting
  3. Step 1: Check the PHP Version and Extensions
  4. Step 2: Create the MySQL Database and User
  5. Step 3: Upload and Extract the Files
  6. Step 4: Point the Document Root at the public/ Folder
  7. Step 5: Configure the .env File
  8. Step 6: Set Folder Permissions and the Storage Link
  9. Step 7: Set Up the Cron Job
  10. If It Still Doesn’t Work
  11. Frequently Asked Questions
  12. Next Steps
Install CodeCanyon PHP Scripts on Shared Hosting: Step-by-Step Guide

Before You Start

  • Access: your control panel login (cPanel, DirectAdmin or Hostinger hPanel) and File Manager or SFTP. SSH access helps but is optional; this guide gives a no-SSH route for each step.
  • Files and details: the item’s ZIP from your Envato downloads, your purchase code for license activation, and the item’s requirements list (PHP version and extensions).
  • Time: about 30 to 60 minutes for a first install.
  • Backup: if the domain or folder already hosts a site, back up its files and database first. Extracting the ZIP can overwrite index.php and .htaccess.
  • Domain and SSL: the domain should already resolve to your hosting with SSL active. If it doesn’t yet, see how to point your Namecheap domain to Hostinger without breaking email before you run the installer.

Why CodeCanyon Scripts Fail on Shared Hosting

Many authors build and test their scripts on a local machine or a VPS with root access. Shared hosting is more locked down: you cannot install system packages, the web root is fixed to public_html, and terminal access may be missing. Each step below works around one of those limits.

Step 1: Check the PHP Version and Extensions

Check what PHP version your account runs before you upload anything. Most modern CodeCanyon items are Laravel builds: Laravel 10 needs PHP 8.1 or newer, Laravel 11 and 12 need PHP 8.2 or newer, and they will crash instantly on anything older. Check the item’s stated requirements.

In your control panel, open PHP Configuration or Select PHP Version, pick the required version, and make sure these extensions are enabled:

  • bcmath, ctype, fileinfo, and json
  • mbstring, openssl, pdo_mysql, and tokenizer
  • xml, curl, zip, and gd (or imagick)

Scripts that resize large uploads, process video or import big CSV files can hit the server’s memory and time limits. If the installer hangs during database migrations, raise those limits first. Our guide to increase the PHP memory limit and execution time on Hostinger shows where the settings live.

Need something less common like intl or sodium? The official PHP extensions documentation explains what each module does.

Step 2: Create the MySQL Database and User

Almost every CodeCanyon script either ships a web setup wizard or a database.sql file you import yourself. Both need an empty database and user ready beforehand.

  1. Open MySQL Databases in your control panel.
  2. Create a new database (e.g., user_portal).
  3. Create a database user with a strong password. Avoid $, quotes and backslashes in it, because some installers fail to write them into .env correctly.
  4. Find Add User to Database, select your user and database, click Add, and tick ALL PRIVILEGES.

Write down the database name, username, password and host. The host is almost always localhost or 127.0.0.1; use whatever your panel shows. Note that cPanel adds your account name as a prefix to database and user names, and Hostinger adds a prefix such as u123456789_. Use the full prefixed names in the script’s settings.

Step 3: Upload and Extract the Files

Upload the script’s .zip with File Manager or SFTP and extract it into the target folder. Turn on Show Hidden Files in File Manager first. Otherwise you can miss dotfiles such as .env and public/.htaccess, and a missing .htaccess breaks every page except the homepage.

Many CodeCanyon downloads contain documentation and the actual script in separate folders. Upload only the script folder the documentation tells you to install.

Step 4: Point the Document Root at the public/ Folder

Older PHP apps keep index.php in the main folder. Laravel-based scripts keep it inside a public/ subfolder, and the rest of the app must stay out of the web’s reach. On shared hosting, your domain usually points straight to public_html.

If you extract everything into public_html and stop there, visitors have to type yourdomain.com/public to see the site. Worse, your .env file, which holds the database password in plain text, may be downloadable by anyone.

Option A: Change the Document Root in the Control Panel

If your host lets you change document roots (standard for cPanel addon domains and subdomains), edit the domain’s settings and change the target folder from:

/home/username/public_html

To the actual public directory:

/home/username/public_html/public

Option B: Rewrite Requests with a Root .htaccess File

If your plan locks the primary domain to public_html with no setting to change it, put a custom .htaccess file in public_html. It sends every request to /public behind the scenes, without showing the folder in the address bar.

Create or edit public_html/.htaccess in File Manager and add:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

To check it, open yourdomain.com/.env in a private browser window. You should get a 404 or 403 page, not the file’s contents. If you see redirect loops or missing CSS and images, the Apache HTTP Server 2.4 documentation explains how to tune the conditions.

Step 5: Configure the .env File

If the script has a web installer, open your domain in the browser and enter the database details from Step 2 when it asks. The installer writes .env for you.

If there is no installer, find .env.example in the script’s root folder, copy it to a new file named .env, and fill in your details:

APP_NAME="AppLauncher"
APP_ENV=production
APP_KEY=base64:Dk3...YOUR_GENERATED_KEY...=
APP_DEBUG=false
APP_URL=https://yourdomain.com

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=cpaneluser_portal
DB_USERNAME=cpaneluser_dbuser
DB_PASSWORD=SecurePassword123!

APP_KEY is the app’s encryption key and must be unique to your install. Most installers generate it. With SSH, run php artisan key:generate in the script’s root folder, and it writes a fresh key into .env. Keep APP_DEBUG=false on a live site.

Wrong file permissions cause most 500 errors on shared hosting. The web server process needs write access to the cache, session and upload folders, and nothing else.

The safe standard on shared servers is:

  • Folders: 755 (drwxr-xr-x)
  • Files: 644 (-rw-r--r--)
  • Upload and cache folders: 775 or 755, depending on how your host runs PHP (suPHP, FastCGI or mod_php). Try 755 first.

For Laravel apps, make storage and bootstrap/cache writable. Over SSH, run these from the script’s root folder (the one that contains artisan):

chmod -R 775 storage
chmod -R 775 bootstrap/cache

The commands print nothing when they succeed. Without SSH, right-click each folder in File Manager, choose the permissions option, enter the value, and apply it to subfolders.

Fix Uploaded Images That Return 404

Laravel saves uploads in storage/app/public and serves them through a symlink (a shortcut folder) at public/storage. The usual way to create it is php artisan storage:link, which needs a terminal. Without one, use a one-off PHP helper.

Create a temporary file named symlink.php in your public/ folder:

<?php
// public/symlink.php - run once, then delete
$target = __DIR__ . '/../storage/app/public';
$link   = __DIR__ . '/storage';

if (!function_exists('symlink')) {
    exit('symlink() is disabled on this host. Ask support to create the link.');
}

if (file_exists($link) || is_link($link)) {
    exit('public/storage already exists.');
}

echo symlink($target, $link) ? 'Symlink created.' : 'Could not create the symlink.';

Open yourdomain.com/symlink.php in your browser once. It should print Symlink created. Then delete the file immediately, so nobody else can run it.

Step 7: Set Up the Cron Job

Most CodeCanyon platforms use cron jobs (scheduled commands) for queued emails, subscription renewals and background syncs. If users never get confirmation emails, cron is the first thing to check.

Open Cron Jobs in your control panel. For Laravel scripts, add one schedule runner that executes every minute (* * * * *):

* * * * * /usr/local/bin/php /home/username/public_html/artisan schedule:run >> /dev/null 2>&1

For standalone PHP scripts, the cron command usually calls the script’s cron file directly. Use the file name and schedule from the item’s documentation:

0 * * * * /usr/local/bin/php /home/username/public_html/cron.php >> /dev/null 2>&1

Double-check the PHP binary path. On many cPanel servers, plain /usr/local/bin/php runs an older default version such as PHP 7.4, not the one you selected in Step 1. Use the full path for your runtime, such as /usr/local/bin/ea-php82 or /opt/alt/php82/usr/bin/php. Your host’s documentation lists the exact path. On Hostinger, our guide to set up a real cron job in hPanel walks through the same Cron Jobs screen.

To confirm the job runs, temporarily replace >> /dev/null with >> /home/username/cron.log and check that file after a few minutes. If you build a custom schedule, check it with Crontab Guru first.

If It Still Doesn’t Work

cURL Error 60: SSL Certificate Problem

This usually appears during purchase code validation. The installer tries to check your license with Envato’s API, but the server’s CA certificates (the list of trusted certificate authorities) are missing or out of date.

Ask your host’s support team to update the CA bundle, or point PHP at a current bundle in your custom php.ini:

curl.cainfo = "/etc/pki/tls/certs/ca-bundle.crt"
openssl.cafile = "/etc/pki/tls/certs/ca-bundle.crt"

500 Error with a Blank Screen

Shared hosting hides PHP errors by default. Open storage/logs/laravel.log in File Manager, or set APP_DEBUG=true in .env for a few minutes. The cause is usually a wrong database password or a missing PHP extension. Set APP_DEBUG back to false as soon as you have the error, because debug pages can reveal your settings to visitors.

Homepage Loads but Every Other Page Returns 404

The public/.htaccess file that Laravel uses for pretty URLs is missing. It is a hidden file, so it is easy to skip during upload. Turn on hidden files, compare the folder with the original ZIP, and upload .htaccess again.

The Installer Says a Folder Is Not Writable

The installer lists the folder it cannot write to. Set that folder to 755 (or 775 if 755 is not enough) as described in Step 6. Never use 777; see the FAQ below for why.

Frequently Asked Questions

Why does my CodeCanyon script say the license code is invalid?

First check that you pasted the purchase code without spaces. If it is correct, the server may be blocking the check. Some strict shared firewalls block outgoing connections to third-party endpoints like api.envato.com until support allows them. Ask your host to allow outbound HTTPS (port 443) to it.

Can I run artisan migrate without terminal access?

Yes. Import the included database.sql file through phpMyAdmin, or add a temporary route in routes/web.php that runs Artisan::call('migrate', ['--force' => true]) when you visit it. Delete that route as soon as the migration finishes, because anyone who finds it could run it.

Should I set folder permissions to 777 to fix upload errors?

No. 777 lets every other account on the server write to your files. Hosts running suEXEC or suPHP also refuse to execute PHP files that are world-writable or sit in a world-writable folder, which shows up as an instant 500 error. Use 755 or 775 instead.

Can I install a CodeCanyon script on a subdomain?

Yes. Create the subdomain in your control panel, extract the script into its folder, and set the subdomain’s document root to the script’s public/ folder (Option A in Step 4). Then use https://sub.yourdomain.com as APP_URL and in the cron paths.

Next Steps

Once the script works, switch its outgoing mail from PHP mail() to authenticated SMTP in the script’s settings. Then publish SPF and DKIM records for your domain, so welcome emails and password resets stay out of spam. Our guide to configure SPF, DKIM and DMARC in Namecheap DNS covers the records step by step.

all_in_one_marketing_tool