In case you bought a PHP script from Codecanyon and you want to install it, or maybe you are a PHP developer, and you want to learn how to publish PHP website online, Then You are in the right place.✔️
In this guide, I will cover the following:
- Requirements .
- Get a Domain Name.
- Get a VPS Server.
- Map Server IP to Domain.
- Create a MySQL Database For Your Application.
- Uploading File to the Server using WinSCP.
- Installing PHP Modules.
- Managing MySQL Databases.
- Setup cronjobs.
Requirements to Publish PHP Website.
What you need is simply is:
- A VPS Server to install your PHP Script on.
- Domain Name to use with our setup.
1. Get a Domain Name To Publish PHP Website.
Getting a Domain is as simple as eating a piece of chocolate cake. you need to go to any Domain registrar company like Godaddy, Hostinger, Enom, Freenom, Namecheap…. and Buy a Domain Name, you can even get one for 1$ per year.
I do recommend to get domain name that reflects your business. and if you already have one, as I think so, you can just skip this, and continue to get a VPS Server.
Watch this 3 Minutes Video and see how to get and buy a domain name from Godaddy:
2. Get a VPS Server.
Now, Let’s get our VPS server to set up our PHP Script on.
What is a VPS Server?
When you want to publish PHP website or script or any web application, we do what we call “web hosting” which simply means uploading the files and database into a public server so it can be accessibly Online over the internet.

Hosting Options.
Now when you want to host a web application (WordPress in our scenario), you have mainly 2 options:
Shared Hosting:
Which means publishing your website on hosting services like Godaddy, Bluehost, Hostinger… where your website will be hosted with hundreds of other websites on the same server.
VPS Hosting
In this setup, you will host your website on your own server, so you will have a server only for you! which is called a VPS or a Virtual Private Server.
Which one is better?
I don’t want to go in depth now and explain technical stuff, but in few works, VPS is Definitely better where you will have your own server with full manageability and better performance.
And if you think that shred hosting is a lot cheaper, then you are wrong, as with Contabo VPS services you can start with a 3.99 € per month Only which is the same pricing for almost 90% of shared hosting services.
Maybe the only drawback here, is that it requires some more technical skills to set up and configure, but fortunately, you are here in the step-by-step guide, where you will see how things will go really easy!
What company should I use?
You can use whatever company you want to buy a VPS Server, in this guide I will share with you two companies that I think has everything you need, and with the cheapest prices. and I use to run more than 10 Servers for my business.
These companies are: Contabo & Digital Ocean.
But as I told you, it's up to you, you can use whatever company you feel comfortable with. you can also go with Hostinger, which also provides a very good pricing compares with other companies.
Note: In this tutorial: I will be using Contabo
So Let's see how we can get a VPS server from Contabo.
Get a VPS Server From Contabo.
1: Open Contabo Website.
Open your web browser and navigate to Contabo VPS Page.

You will see multiple VPS configuration to start with. You can simply start with the cheapest option to Install WordPress, it will be more than enough.
Later on, when you grow your business, you can scale up and get a more powerful VPS with Higher resources.
2: Set VPS Options
On the Next Page, you will need to select some options
In the Operating System Option, Select Ubuntu 18.04

Then in the Administration Panel, Select LAMP

And last option, In the Addons, check “Individual reverse DNS”

If you were promoted to enter the PTR record, enter your domain name, and That’s it.
Now, Just Continue to the billing page, and confirm your order. I think other steps are simple and self explanatory.
In like 24 hours, Contabo Team will setup the Server and send the details to your email like this:

For Digital Ocean.
If you want to go with Digital Ocean, simply Sign up through the coupon link below to get free 100$ to test everything free.
And after you signup on Digital Ocean, just create a Droplet with the following specifications:
- Ubuntu 16/18/20 x64 as your operating system.
- You can start with 1 CPU/ 1 GB RAM (You can resize later).
Great! You Got Your Server. ✔️
Check Also:
3. Map Domain Name to your VPS Server.
Ok Friend, Now we have a Domain and a VPS Server. But they are not connected!
Your VPS Server can be accessed now through the IP address that Contabo Team sent you by email. but of course, we don’t want to access our WordPress website though an IP! we want to use our domain name.
So simply, we are going to map the domain name to our VPS IP, so then we access the VPS and the WordPress website through both the domain and the IP.
Configure your DNS Records:
Simply open DNS management zone in your Domain Provider (Godaddy in my case) and edit the main A record like this:
host: @ points: YOUR SERVER IP.

Done? Great! ✔️
4. Create a MySQL Database For Your Application.
To Publish PHP Website, the Majority of PHP scripts and applications, will require a MySQL Database. So Let's Create one.
Connect to your VPS server using any SSH client like putty. and Let’s start!

Just open Putty and enter the Server IP or Name, and Press Open.
It will ask you to login, just enter “root” as the user, then enter your password which is sent to you by email.
Note: while typing the password, putty will now show it for security reasons, but It’s there, just type it!

And you are In!
What's nice, is that we have MySQL installed already as part of the LAMP Stack, but we need to create a database and a user for out application.
To get started, log into the MySQL root (administrative) account by issuing this command:
mysql -u root -p
You will be prompted for the root password, just write or paste it and press Enter.
First, create a separate database that your PHP application will use. You can call this whatever you want, but we will be using TestDb in this guide to keep it simple. Create the database by running this command:
CREATE DATABASE TestDb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
Note: Every MySQL statement must end in a semi-colon (;)
Next, we are going to create a separate MySQL user account that we will use exclusively to operate on our new database. Creating one-function databases and accounts is a good idea from a management and security standpoint. We will use the name DbUser in this guide. Feel free to change this if you’d like.
We are going to create this account, set a password, and grant access to the database we created. We can do this by typing the following command. Remember to choose a strong password here for your database user:
CREATE USER 'DbUser'@'localhost' IDENTIFIED BY 'enter_a_custom_password_here';
GRANT ALL ON TestDb.* TO 'DbUser'@'localhost';
You now have a database and user account, each made specifically for Your PHP application. We need to flush the privileges so that the current instance of MySQL knows about the recent changes we’ve made:
FLUSH PRIVILEGES;
Exit out of MySQL by typing:
EXIT;
Done! ✔️
5. Upload The Script Files To The Server.
To upload the files, you need an application called WinSCP.
It is a free tool and you can download it from here.
Connect to Your VPS Server using WinSCP, and Update the PHP Files to the server to this path: “/var/www/html”
In most cases, the files would be zipped, so we need to extract them.
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:
clear
Change directory to /var/www/html using the following command:
cd /var/www/html
Unzip the “.zip” file using the following command:
unzip YOURFILENAME*.zip
*Note: the file name may be different in your case, so replace YOURFILENAME with your file name.
Now, Move the latest folder content to the upper directory so it can be accessed directly -> use WinSCP
Just copy all the files inside “YOURFILENAME” folder and paste them directly in html folder.
Files Uploaded. Done! ✔️
6. Installing PHP Modules To Publish PHP Website (optional)
Some PHP applicaiton will require some additional PHP modules on your server( this is will be mentioned in the app documentation)
To Install additional PHP modules:
Open Putty, and run the following commands to install PHP Modules:
sudo apt install php-curl sudo apt install php-mbstring sudo apt install php-example ......
*Restart apache service using the following command:
sudo service apache2 restart
Done! ✔️
7. Configure Apache to Publish PHP Website
Well Done, Now your files are uploaded and placed in the html folder, we just need to configure apache so we can our Publish PHP Website and access our script using our domain name. To do so, open WinSCP again and navigate to this directory: /etc/apache2/sites-available/
Now, create a new empty file and name it “yourdomain.conf” . You can replace “Scriptname” with any name you want (Below is an example naming it mautic.conf).

Open yourdomain.conf Then copy and paste the content below into the file and save.
<VirtualHost *:80> ServerAdmin admin@YOUDOMAINNAME DocumentRoot /var/www/html ServerName YOUDOMAINNAME ServerAlias YOUDOMAINNAME <Directory /var/www/html/> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Replace with your own domain, in my case its “YOURDOMAINNAME”
Enable your script configuration in apache and restart the service.
Now simply, run the following commands to finish the setup:
sudo a2ensite yourdomain.conf sudo a2enmod rewrite sudo systemctl restart apache2.service
GREAT! You are almost done
8. Connect to MySQL Database.
Open your web browser now and navigate to your server name.
You must see the setup completion wizard below:
Continue the setup by entering the database info and your admin login information. In our example, the database name is TestDb and the user is DBUser with the password set.
That simple! Check below example from a similar script.

Connect to database. Done! ✔️
9. Setup cronjobs.
What are cronjobs?
cron is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks.
For example, you can set a cron job to delete temporary files every week to conserve your disk space. Some PHP web applicaitons, may require you to set up a cron job to perform certain functions.
Setup cronjobs.
To setup cronjobs, you need to add all required jobs to the server. This depends on your script, so if you bought a script from code canyon, the script owner should provide the cronjobs.
To do this, open WinSCP and got to /etc
Open crontab file using the editor
And paste all the jobs from your script to this folder. (cronjobs are listed in the app documentation)
Make sure each job is on a line and an empty line in the end.
Cronjobs. Done! ✔️
10. Secure with a Free SSL.
SSL certificates are used within web servers to encrypt the traffic between the server and client, providing extra security for users accessing your application. Let’s Encrypt provides an easy way to obtain and install trusted certificates for free.
Connect to your Server using Putty SSH client. and Let’s Start!
Step 1 — Install the Let’s Encrypt Client
Let’s Encrypt certificates are fetched via client software running on your server. The official client is called Certbot.
First, add the repository to install Certbot:
sudo add-apt-repository ppa:certbot/certbot
You’ll need to press ENTER
to accept.
Then, Update the package list to pick up the new repository’s package information:
sudo apt-get update
Install Certbot’s Apache package:
sudo apt install python-certbot-apache
Certbot is now ready to be used.
Step 2 — Set Up the SSL Certificate
Generating the SSL certificate for Apache using Certbot is quite straightforward. The client will automatically obtain and install a new SSL certificate that is valid for the domains provided as parameters.
Simply run the following command: (change the domain)
sudo certbot --apache -d YOUR_DOMAIN_NAME
You will be asked to provide an email address for lost key recovery and notices, and you will be able to choose between enabling both http
and https
access or forcing all requests to redirect to https
. It is usually safest to require https
, unless you have a specific need for unencrypted http
traffic.
That’s it!
Test your website now and it should be SSL encrypted.
Done! ✔️
I wanted to know how to host this on the free servers
What do you mean on free servers? This should be hosted on a VPS machine where people would have access to check it.
Can you please make tutorial video on YouTube regarding “How to enable SSL?” also show us how to install a custom theme for our Premium URL shortener.
We will try to add it to our schedule.
Urgent: This is the error i am getting when i try to set up the Premium URL Shortener script on my VPS server. The error is “SQLSTATE[HY000] [1044] Access denied for user ‘dbuser’@’localhost’ to database ‘urlDB'”
Hello Friend,
For technical questions, please post them on h-educate.com/forums.
Great Content thanks a lot.
Great!
Can I install PhP SCRIPT on VPS hosting on which I have already 5 websites hosted.. Or I should buy a separate VPS hosting for PHP script?
Also, could you tell us, which VPS machine would work well for 10-15 websites hosting?
Just get a VPS with high specs. But why have a single point of failure for all your websites?
can we install it on a shared web hosting
Better on a separate VPS. For more questions, please post on h-educate.com/forums.
HI Hasan,
Everything you tell in the video but Did not tell whether to take web hosting or not.
and can I make the same SEO tool web site like you?
What do you mean webhosting friend? We mentioned that you need a VPS server. For more questions please head to h-educate.com/forums to help you better.
HI Hasan,
Everything you tell in the video but Did not tell whether to take web hosting or not.
and can I make the same SEO tool web site like you?
Dear Hassan,
First of all, let me appreciate your kind efforts and the humanism you are imparting on the internet. Well done! You are really a great person!
My name is Kashif Soomro, and I watch your videos on YouTube and try to follow your guidelines.
After watching your videos, I installed the A to Z Tools PHP script on my website.
But the issue is that features of the application are not working despite successful installation.
Bro can kindly guide me on how to resolve this issue. I would be really grateful.
Looking forward to your early response.
Thank you and kindest regards,
Thank you for the feedback. Please post your questions on h-educate.com/forums.
Step #7
* If you create own yourdomain.conf file, then you have to assign new file and remove old one:
sudo a2ensite your_domain.conf
sudo a2dissite 000-default.conf
* Test if all synatx is good:
sudo apache2ctl configtest
* You should see something like:
Output
Syntax OK
* Now it is time to restart:
sudo systemctl restart apache2
The step 7 is not working. I tried both ways (article’s and yours). Just not sure what’s going on. It keeps on giving error message: “The requested URL was not found on this server.”
“Apache/2.4.41 (Ubuntu) Server at YOURDOMAINNAME.com Port 80.” whenever I try to access any admin panel menu.
The /etc/apache2/sites-available/000-default.conf file has the block that is pointing towards /var/www/html. Not sure why the page is unable to find the pages. The following block is added in the 000-default.conf file before error log. Any idea?
Options +FollowSymlinks
AllowOverride All
Require all granted
Please post the issue on h-educate.com/forums.
Hi Hassan,
I stuck at command: mysql –u root -p
It not worked. It showed:
“Could not find command-not-found database. Run ‘sudo apt update’ to populate it.
mysql: command not found”
Please help me solve it!
Did you install the Database system? Please post questions on h-educate.com/forums for better help.
I have not installed it yet. Please reply my question on forum
Hello! I followed everything but i cant set up cron jobs. 🙁 Please if you can help me?
Hi Friend,
Needed cronjobs are supplied by the script programmer.
i have setup all step by step but when i on (Database Installation) its says SQLSTATE[HY000] [1044] Access denied for user ‘@’localhost’ to database ”
please let me know how i fix it ?
Friend,
Please post questions on h-educate.com/forums.
hi every one please any one can explain how to install all in one video downloader script i don’t know even how to create a website.
Friend,
We have a step by step guide in the article. Just start and ask us any question on h-educate.com/forums.
Is it possible to host 2 different domains on one single VPS server running their own scripts?
How would one test the max resources needed to run both these scripts?
Hey Friend,
Please post on h-educate.com/forums for better help.
I accidently deleted winscp folders site enable and site available , and i lost all progress and is unabe to access the webpage now. Please Help
Hello Friend,
Please post questions on h-educate.com/forums.
Thanks for this detailed instruction!
Hi guys need help after getting full access of Maintenance Settings Control panel it is still redirecting to admin/install/install.php why is that
Please post questions on h-educate.com/forums.
Hello, After installation delete the install folder. /var/www/html/admin/
after open admin folder go delete the install folder.
Hello, After installation delete the install folder. /var/www/html/admin/
after open admin folder go delete the install folder.
Please post questions on h-educate.com/forums
I have one query, for the operating system you choose ubuntu 18.04 but mine is windows 10…….so what should I select from the list??
Please ask questions on h-educate.com/forums.
thank you sir for providing such value on youtube. I am following you from long time.
Thank you. Keep following us for more.
Dear Hassan.
Thank for your help and your tutorials. I am following step by step your tutorial but i`m having troubles with the maintenance section. I’ve done it excatly as u explained in youtube video i change the 00.default.conf and in the vps i run the command : sudo a2enmod rewrite. and still i cannot go to the maintenance mode.
Not Found
The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at
Can u please give me a hand?
Please post technical questions on h-educate.com/forums.
Guy i really need some help with A To Z SEO tools this scrip is making me crazy i can’t access the user interface each time i type may Url it will open the installer panel
pls i need some help
Hi friend, did you try contacting the author, maybe it’s a bug or so