How to host a PHP script online in 10 minutes? example: Xerochat from Codecanyon

host php script codecanyon

Host a PHP Script

If you are a PHP Developer, or anyone who bought a PHP Script and wants to host and install this PHP script (web application) Online, Then You are in the right place.

In this tutorial, I will show you a step by step guide on how to Install any PHP Script Online in 10 minutes and I will pass by the main concepts like:

  • Creating a VPS Server
  • Configuring the Server USing Putty SSH Client
  • Uploading File to the Server using WinSCP
  • Installing PHP Modules
  • Managing MySQL Databases
  • Setup cronjobs
  • Mapping our Domain Name

I will Host an Example Script called “XEROCHAT Facebook Marketing application” which requires some PHP modules, a Database, and some cronjobs.

So it will be a good example to use in order to understand almost all the concepts that may face you while hosting and installing a PHP Application.

This article depends on my Full Video “How to Host and Install Any PHP Script Online in 10 Minutes? | Example: Xerochat from Codecanyon”, so please watch the video to understand what we are doing here.

Here is the Video:

Getting Started

The first thing we will need is a Public VPS Server to host our PHP web application on.

I will be using Digital Ocean to Get a VPS Server in this scenario for two reasons:

  1. Digital Ocean has already Configured Servers (LAMP) For hosting which makes it a lot easier as you will see later, so we don’t need to install Apache, MySQL, PHP, or anything else.
  2. I will give you a Free coupon, so you can test everything for free, to get the coupon, click and sign up using the link below:

So Just Signup and Create a VPS Droplet Machine and be sure to Select Lamp Server as your Server System as Explained in the Video.

Reset Droplet Password

After you create the Droplet, you will receive an email containing the root default password.

Simply connect to your Droplet using Putty SSH Client and Reset the password.

Upload PHP Files to Your Server

Connect to Your VPS Server using WinSCP, and Update the PHP Files to the server to this path: “/var/www/html”

In my case, I have a Zipped file, so I need to extract it. So again to Putty SSH CLient and Let’s install the unzip utility using the following command:

sudo apt-get install unzip

Clear putty screen to make in clean using the following command:


Change directory to /var/www/html using the following command:

cd /var/www/html

Unzip the “.zip” file using the following command:


*Note: the file name may be different in your case, so replace xerochat with your file name.

Now, Move the latest folder content to the upper directory so it can be accessed directly -> use WinSCP
Just Drag and Drop using WinSCP
Then delete the html folder, and rename “xerochat” to html.
In this way, the Your PHP files are in the html folder directly, so it can be accessed directly using your domain name.

Start Installation

Now you can open your browser, and enter the Droplet IP and You will see the application startup page.

Install PHP modules

Open Putty, and run the following commands to install PHP Modules:

sudo apt install php-curl
sudo apt install php-mbstring

*Restart apache service using the following command:

sudo service apache2 restart

Create the Database

1- Open Putty SSH Client and run the following command:

 mysql -u root -p 

Login to MySQL with your root password

2- Create the database using the following command:


3- Create a new user if root has not local accessible

CREATE USER ‘xero’@’localhost’ IDENTIFIED BY ‘Xero_db_pass123’;
GRANT ALL PRIVILEGES ON * . * TO ‘xero’@’localhost’;

Setup cronjobs

Open WinSCP and got to /etc
Open crontab file using the editor
And paste all the jobs from Xerochat ( or your application)  as explained in the video.

Now, the last step is to point your domain name to your IP address in the DNS management zone.


Related Articles


Your email address will not be published. Required fields are marked *

  1. I wanted to watch your video but it didn’t show up and the page stay in download loop for ever! Just wanted to let you know.

  2. Everything seems doable but from where will I get the cronjob codes? I’m not a developer and currently cant hire one. Can you point to a resource on some templates (If they can be called so!) of cron jobs?

  3. Hi Hassan i tried to follow up ur video tutorial using digitalocean but i didnt received email with credentials (such as user, password and ip) as shown in your video. What I should do?

    I’m trying to host a PHP Script from codecanyon

  4. Follow your video to the letter, it didn’t work tried everything and nothing happen waste of time but thanks anyway…I deleted the html file as per your video and refresh the page but I didn’t see the other html file only thing that was there was just the zip file it just didn’t work sorry…

  5. Good Day Hasan.

    I am following along with your video in “How To Host and Install Any PHP Script Online In 10 Minutes. However, I am stuck. I am at the script’s “Installer”. However, it will not install. All of the DB info is correct, but the installer says:
    ” The database configuration file could not be written, please chmod application/config/database.php file to 777 OR Email and Password not passed validation. ”

    Also, the developer notes say:
    ” NOTE : – Please chmod application/config/database.php, install/data and all files inside this folder to 777. ”

    Please tell me What Is This and How/Where Do I Do This??

    I read all over the internet as to how dangerous it is to invoke this ‘chmod 777 ‘ (Should the command actually be: sudo chmod -R 777?). Should I be as concerned as I am about this???

    Lastly, Are there other comparable PHP script sources that you trust and use???

    Thank You!!

  6. Please is there any video you have created regarding using shared hosting because as of now that is what i have to practice as a beginner in the game and then scale up as time goes on.

  7. when i used command to creat user find error

    I don’t have much skill with programming. I have some error look like

    CREATE USER ‘xero’@’localhost’ IDENTIFIED BY ‘Xero_db_pass123’;
    GRANT ALL PRIVILEGES ON * . * TO ‘xero’@’localhost’;

    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘‘Xero_db_pass123’’ at line 1
    MariaDB [(none)]> CREATE USER ‘xero’@‘localhost’;