How to Upload Php Website on CPanel

Arhaan Ali
4 min readJan 19, 2024

--

Guys, in this tutorial I’m going to teach you How to Upload a PHP website on Cpanel. Guys, if you have a project in PHP and MySQLi you want to upload your project with Online Server or CPanel. You need to have a Domain Name and Web Hosting.

Domain Name represents your website name such as www.yoursite.com and Web Hosting represents storing your site data and also displaying your site around the world. So, First of All, we need to Buy Domain and Web Hosting.

If you’ve developed a dynamic website using PHP and are ready to take it live, cPanel provides an excellent platform for hosting and managing your PHP-based web applications. In this guide, we’ll take you through the step-by-step process of uploading your PHP website to cPanel, making it accessible to users worldwide.

Guys, There are a lot of Web Developers or Online entrepreneurs using International Web Hosting Companies. Because those companies provide superb services and International Companies’ servers running on the web 24/7.

It means your site running on the web 24/7 and also you will get online support. If you will face any problem which related to your Web Hosting, Domain Registration and Also Payment, etc. You can contact them via Email or Live Chat.

Guys, There are a lot of Online Companies available, that are providing Domain Registration and Also Web Hosting. You can get the domain and hosting and follow my below steps.

Begin by logging in to your cPanel account provided by your web hosting provider. Once logged in, locate and open the “File Manager.” This tool enables you to handle files and directories on your hosting server.

Before uploading your PHP website, make sure all your website files, including PHP scripts, CSS stylesheets, images, and other assets, are organized within a single folder on your local computer.

You May Also Like:

How to Upload Php Website on CPanel

Here are a few things you need to follow on it, and then your Php website will be live on Cpanel or an Online Server. Also, I made a video tutorial on it, you can watch the video till to end I explained each step from scratch.

Uploading Files to cPanel

  1. Launch the “File Manager” in cPanel.
  2. Navigate to the “public_html” directory, which serves as the root directory for your website. If you want your PHP website to be the main page when users visit your domain, upload your files directly into this folder.
  3. Click on the “Upload” option from the top menu.

Using the File Upload Manager

  1. Click the “Select File” button in the file upload manager.
  2. Locate and select the folder containing your PHP files on your local computer.
  3. Highlight all the files you wish to upload and click “Open.”
  4. Your files will appear in the upload manager. Click the “Upload” button to initiate the upload process.

I hope you’ve watched the complete tutorial hope you’ve learned something new from this tutorial.

How to Upload Php website on Server with Database.

Verifying File Upload

After the upload is complete, return to the “File Manager” to ensure that your PHP files are present in the “public_html” directory. Confirm that all the necessary files, including PHP scripts and associated assets, are correctly uploaded.

Configuring PHP Settings

In cPanel, you can configure PHP settings to match the requirements of your website. Access the “Select PHP Version” option to set the PHP version and adjust other settings as needed.

Testing Your PHP Website

To ensure that your PHP website is functioning correctly, open a web browser and navigate to your domain or the specific folder where you uploaded your files. If everything is configured properly, your PHP website should be live on the internet.

Database Setup (If Applicable)

If your PHP website relies on a database, you’ll need to set up the necessary database and user credentials in cPanel. Access the “MySQL Database Wizard” or “MySQL Databases” option to create a new database, or a user, and assign the user to the database. Update your PHP scripts with the correct database connection details.

Domain Configuration

If your PHP website is intended to be the primary content of your domain, you may need to configure your domain settings in cPanel. Navigate to “Addon Domains” or “Parked Domains” to add your domain and ensure it points to the correct directory where your PHP files are located.

File Permissions

Verify and set appropriate file permissions for your PHP files and directories. In the “File Manager,” right-click on the files or directories, select “Change Permissions,” and ensure that they have the necessary read, write, and execute permissions.

Secure Your PHP Website

Implement security measures to protect your PHP website from potential threats. Update your PHP version regularly, secure your database, and consider installing an SSL certificate for secure data transmission. cPanel often provides tools for managing security features, so explore the available options.

Regular Backups

To safeguard your PHP website, schedule regular backups through cPanel. Access the “Backup” or “Backup Wizard” option to create automatic backups of your website files and databases. This ensures that you can quickly restore your website in case of any unexpected issues.

Conclusion:

Uploading a PHP website to cPanel is not only about making your site live but also about optimizing its performance, ensuring security, and maintaining its stability. By following these additional steps, you can enhance the functionality and reliability of your PHP web application. With your PHP website now hosted on cPanel, you are well-prepared to provide a seamless and secure experience for your users while having the tools to manage and maintain your website effectively.

--

--

Arhaan Ali

I’m Developer and Blogger I’ve been sharing my personal expereince on Udemy, YouTube and Also Personal Website.