If you bought a PHP script, a ready-made web application, or a SaaS script and want to install it on your live cPanel hosting, this tutorial is for you. Here, you will learn exactly how to set up a PHP script on cPanel.
Once you purchase a script and download its ZIP file, you might wonder what to do next. Many beginners get stuck at this stage. We will guide you through the exact next steps. Whether you bought a script from the Techno Smarter store or anywhere else, we will show you how to install it easily on a cPanel server.
In this quick step-by-step guide, you will learn how to install a PHP and MySQL script in cPanel without writing a single line of code.
Step 1: Upload and Extract the ZIP File
- Log in to your hosting cPanel.
- Scroll down to the Files section and click on File Manager.
- Open the
public_html folder (this is your main website directory).
- Click the Upload button at the top and select your downloaded script
.zip file.
- Once uploaded, right-click the
.zip file and select Extract. Your source code files are now live on the server!
Step 2: Create a MySQL Database
Your script needs a database to store user data, logins, and settings.
- Go back to the main cPanel dashboard and click on MySQL® Database Wizard.
- Create a Database: Give it a name (like
mysite_app) and click Next Step.
- Create Database Users: Create a username and generate a strong password. (Important: Copy this password to a Notepad!)
- Check the "All Privileges" box and click Next Step. Your database is ready.
Step 3: Connect the Database to Your Script
Now, we need to tell your PHP script where the database is.
- Go back to File Manager (
public_html).
- Look for a configuration file. It is usually named
config.php, database.php, or .env.
- Right-click the file and select Edit.
- Paste your new Database Name, Database Username, and Password in the correct fields.
- Click Save Changes.
Step 4: Import the .sql File
The final step is to create the tables inside your database.
- Open your cPanel dashboard and click on phpMyAdmin.
- On the left sidebar, click the database name you created in Step 2.
- Click the Import tab at the top.
- Click Choose File and select the
.sql file that came with your downloaded script (usually inside a "Database" or "SQL" folder).
- Scroll down and click Import.
That’s it! Open your website URL in the browser, and your SaaS application should run perfectly.
Watch the Live Step-by-Step Installation:
Frequently Asked Questions (SEO FAQs)
Q1: What should I do if I get a "500 Internal Server Error" after installation?
This usually happens for two reasons: Either the database credentials in your config.php are wrong, or your server runs an older PHP version. Go to cPanel -> Select PHP Version and ensure it is set to PHP 8.1 or higher.
Q2: Can I install a PHP script on an Addon Domain or Subdomain?
Yes! The process is exactly the same. Instead of uploading the ZIP file to public_html, just upload it to the specific folder created for your Addon Domain or Subdomain inside the File Manager.
Recommended Posts:-