How to Install a PHP Website Script on Hosting (cPanel and hPanel)
Got a PHP script zip and a hosting account? Follow these steps to upload, connect the database and launch your site, plus fixes for common errors.
- To install a PHP website script, you upload the script's zip file to your hosting, extract it, create a MySQL database, and then run the installer or edit the config file.
- Most shared hosting panels (cPanel, Hostinger hPanel and others) have a File Manager and a MySQL database tool, so you do not need any coding.
- Always read the script's own readme first. It tells you the PHP version, database steps and admin login details.
- After installing, turn on SSL (HTTPS), change the default admin password and delete the installer if the readme asks you to.
You bought or downloaded a ready-made PHP website script. Now you have a zip file and a hosting account, and you are not sure how to connect the two. Many beginners get stuck at "database error" or a blank page.
This guide shows the general steps to install a PHP script on shared hosting, with cPanel and hPanel menu names, plus fixes for the most common errors.
What you need before you start
- A domain name pointed to your hosting.
- PHP hosting with MySQL. Most shared hosting plans include both.
- The script zip file and its readme or install guide.
- Your hosting panel login (cPanel, hPanel or similar).
- About 30 to 60 minutes for your first install.
Step 1: Check the script's requirements
Open the readme inside the zip on your computer. Look for:
- The PHP version it needs (for example, a minimum version).
- PHP extensions it needs, such as PDO, mysqli, GD (for image tools), cURL or mbstring.
- Whether it has a web installer (like
install.php) or needs you to edit a config file. - Which folder to upload (sometimes the zip has an
uploadorsrcfolder inside).
In cPanel, you can usually change the PHP version under Select PHP Version or MultiPHP Manager. In Hostinger hPanel, look for Advanced > PHP Configuration.
Step 2: Upload the zip with File Manager
- Log in to your hosting panel and open File Manager.
- Open the folder for your domain. For the main domain this is usually
public_html. - Click Upload and choose the script's zip file.
- When the upload finishes, right-click the zip and choose Extract.
- Check where the files went. The file
index.phpshould be directly insidepublic_html, not inside an extra folder likepublic_html/script-v1/. - If the files are inside an extra folder, select all files in that folder and Move them up into
public_html. - Delete the zip file after extracting.
.htaccess file that is needed for clean URLs. If it is missing, pages other than the home page may show a 404 error.Step 3: Create a MySQL database and user
In cPanel
- Open MySQL Database Wizard.
- Enter a database name and click Next.
- Create a database user with a strong password. Save the password somewhere safe.
- On the privileges screen, tick All Privileges and finish.
In Hostinger hPanel
- Go to Databases > Management.
- Enter a database name, username and password, then click Create.
Write down four things: database name, database username, password and host. The host is usually localhost on shared hosting, but your panel shows the correct value.
u123456_mydb. Use the full name with the prefix, or the connection will fail.Step 4: Import the SQL file (only if the readme says so)
Some scripts create tables automatically through their installer. Others ship a .sql file you must import.
- Open phpMyAdmin from your hosting panel.
- Click your new database in the left list.
- Open the Import tab, choose the
.sqlfile and click Import (or Go).
Step 5: Run the installer or edit the config file
There are two common ways scripts connect to the database:
| Method | What you do | Signs your script uses it |
|---|---|---|
| Web installer | Visit yourdomain.com/install/ or install.php and fill the form | Readme mentions "installer" or "setup wizard" |
| Config file | Edit a file like config.php or .env in File Manager and enter the database details | Readme mentions "edit config" |
In both cases you enter the same four details from Step 3. The installer usually also asks you to create an admin account. Use a strong password, not "admin123".
Step 6: Turn on SSL and secure the site
- In your panel, open the SSL section and install the free certificate if it is not already active.
- Open your site with
https://and check that the padlock shows. - If the readme says so, delete or rename the
installfolder. - Log in to the admin panel and change any default password.
- Fill in site name, logo, contact details and your About, Contact and Privacy Policy pages.
Common install errors and how to fix them
| Error | Likely cause | Fix |
|---|---|---|
| "Error establishing a database connection" or "Access denied for user" | Wrong database name, user, password or missing prefix | Re-check the four details and that the user is added to the database with all privileges |
| Blank white page | PHP error hidden, often wrong PHP version or missing extension | Switch to the PHP version in the readme; enable the needed extensions; check the error log in your panel |
| Home page works, other pages show 404 | Missing .htaccess or files in the wrong folder | Show hidden files, re-upload .htaccess, check folder location |
| "Permission denied" when uploading images | Upload folder not writable | Set the folder permission as the readme says (often 755) |
| Site shows "Not secure" | SSL not active or site still using http links | Install SSL and set the site URL to https in the admin settings |
After install: make the site ready for visitors and AdSense
A script gives you the structure. Visitors and Google still need useful content. Before applying for AdSense:
- Add enough original, helpful posts or tool pages.
- Make sure every menu link works and there are no demo or "lorem ipsum" pages left.
- Add your site to Google Search Console and submit the sitemap.
- Go through our AdSense approval checklist.
If you are still deciding between a script and other platforms, read Blogger vs WordPress vs PHP script. For niche ideas, see our guides to a Shayari website and a photo and signature resizer website.
Where GeniusGuru scripts fit
All scripts in the GeniusGuru marketplace are built for normal PHP shared hosting, and buyers get a setup guide. Popular picks include the Shayari website script and the Sarkari form photo and signature resizer script. Follow the guide that comes with your script, because each one may have its own steps.
Final word
Installing a PHP script is a repeatable process: check requirements, upload and extract, create a database, connect it through the installer or config file, then secure the site. Most errors come from a wrong database detail, the wrong PHP version, or files in the wrong folder, and all of these are easy to fix.
Next step: open your script's readme now and note the PHP version and install method. Then follow Steps 2 to 6 above in one sitting.
Frequently asked questions
Do I need coding skills to install a PHP script?
No. For most scripts you only upload files, create a database and fill a form or a config file using your hosting panel.
What is the database host on shared hosting?
It is usually localhost, but your hosting panel shows the correct value next to your database details.
Why does my site show a blank page after install?
It is often a PHP version mismatch or a missing PHP extension. Switch to the version in the readme and check the error log in your panel.
Can I install a PHP script on Blogger?
No. Blogger does not run PHP. You need PHP hosting with MySQL.