{"id":3658,"date":"2020-12-15T16:15:33","date_gmt":"2020-12-15T16:15:33","guid":{"rendered":"https:\/\/servicesground.com\/?p=3658"},"modified":"2020-12-15T19:10:32","modified_gmt":"2020-12-15T19:10:32","slug":"how-to-host-any-php-script-online-step-by-step","status":"publish","type":"post","link":"https:\/\/servicesground.com\/blog\/how-to-host-any-php-script-online-step-by-step\/","title":{"rendered":"How to host any PHP script online | Step By Step"},"content":{"rendered":"\n
If you are working as a developer and desired to host and install the web application i.e., PHP script online, then follow the above guidelines to complete the installation process successfully. <\/p>\n\n\n\n
In this article, I will show you a brief guideline on how to host any PHP Script online in a couple of minutes. So first, go through the main concept:<\/p>\n\n\n\n
Let’s start the process, here I’ll take the “XEROCHAT FACEBOOK MARKETING APPLICATION” as an example script. This script requires some PHP modules, a Database, and some cronjobs. <\/p>\n\n\n\n
You can better understand the concept through this example. So, the hosting and installing process will be easy for you to understand.<\/p>\n\n\n\n
Getting started, Public VPS Server is the first thing you need to host your PHP web application on. So, in this scenario I will use Digital Ocean<\/a> to get a VPS Server because of the following two reasons:<\/p>\n\n\n\n Reset Droplet Password<\/strong><\/strong><\/p>\n\n\n\n You will get the email containing the root default password when you created the Droplet. So, use the Putty SSH Client to connect to your Droplet and reset the password.<\/p>\n\n\n\n Then, use the WinSCP to connect to your VPS server and update the PHP files to the server through the given path:<\/p>\n\n\n\n In this scenario, I have zipped files that need to be extracted. So, again to Putty SSH Client and install the unzip utility by running the following command:<\/p>\n\n\n\n Run the following command to clear the putty screen to make in clean:<\/p>\n\n\n\n Then, change the directory to \/var\/www\/html by running the following command:<\/p>\n\n\n\n Unzip the files by running the following command:<\/p>\n\n\n\n In your case, the file name can be different so, rename the files with your file name.<\/p>\n\n\n\n Now move the content folder to the upper directory to be accessed directly -> use WinSCP.<\/p>\n\n\n\n Then drag and drop by using WinSCP<\/p>\n\n\n\n Delete the html folder and replace the “xerochat” with html.<\/p>\n\n\n\n Now your PHP files are in the html folder, so you can use your domain name to access the script directly.<\/p>\n\n\n\n Start Installation<\/strong><\/strong><\/p>\n\n\n\n Now you can open the application startup page by entering the Droplet IP into the browser.<\/p>\n\n\n\n Install PHP modules<\/strong><\/p>\n\n\n\n Open putty, and install the PHP modules by running the following command:<\/p>\n\n\n\n Now, run the following command to restart the Apache service:<\/p>\n\n\n\n 1-<\/strong> Open Putty SSH Client and run the following command:<\/p>\n\n\n\n Login to MySQL with your root password<\/p>\n\n\n\n 2-<\/strong> Create the database using the following command:<\/p>\n\n\n\n 3-<\/strong> If the root has not local accessible, then create a new user:<\/p>\n\n\n\n Now, setup the cronjobs by following the above steps:<\/p>\n\n\n\n Now, point your domain name to your IP address in the DNS management zone. That’s it.<\/p>\n\n\n\n GoodLuck! Thanks for Reading<\/span>.<\/p>\n\n\n\n If you liked this article and want to read more of these, please subscribe to our newsletter and follow us on\u00a0Facebook<\/a>,\u00a0YouTube<\/a>, and\u00a0Twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":" Host a PHP Script If you are working as a developer and desired to host and install the web application i.e., PHP script online, then follow the above guidelines to complete the installation process successfully. In this article, I will show you a brief guideline on how to host any PHP Script online in a […]<\/p>\n","protected":false},"author":24,"featured_media":3664,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[240,1586],"tags":[1614,1612,1613,1611,1615],"yst_prominent_words":[641],"_links":{"self":[{"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/posts\/3658"}],"collection":[{"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/comments?post=3658"}],"version-history":[{"count":2,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/posts\/3658\/revisions"}],"predecessor-version":[{"id":3665,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/posts\/3658\/revisions\/3665"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/media\/3664"}],"wp:attachment":[{"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/media?parent=3658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/categories?post=3658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/tags?post=3658"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/servicesground.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=3658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}Upload PHP Files to Your Server<\/strong><\/h3>\n\n\n\n
Getting Started<\/code><\/pre>\n\n\n\n
sudo apt-get install unzip<\/code><\/pre>\n\n\n\n
clear<\/code><\/pre>\n\n\n\n
cd \/var\/www\/html<\/code><\/pre>\n\n\n\n
unzip xerochat.zip<\/code><\/pre>\n\n\n\n
*Note:<\/strong><\/h3>\n\n\n\n
sudo apt install php-curl\r\nsudo apt install php-mbstring\r\n<\/code><\/pre>\n\n\n\n
sudo service apache2 restart<\/code><\/pre>\n\n\n\n
Create the Database<\/strong><\/h3>\n\n\n\n
mysql -u root -p <\/code><\/pre>\n\n\n\n
CREATE DATABASE xero;<\/code><\/pre>\n\n\n\n
CREATE USER \u2018xero\u2019@\u2019localhost\u2019 IDENTIFIED BY \u2018Xero_db_pass123\u2019;\r\nGRANT ALL PRIVILEGES ON * . * TO \u2018xero\u2019@\u2019localhost\u2019;\r\nFLUSH PRIVILEGES;\r\n<\/code><\/pre>\n\n\n\n
Setup cronjobs<\/strong><\/h3>\n\n\n\n
<\/p>\n\n\n\n