Install nginx and php7 on ubuntu 16.04

First of all get all updates.

sudo apt-get update

Install nginx server

sudo apt-get install nginx

Now open http://server_domain_or_IP You should see the default page of nginx.

The default directory is /var/www/html/

Now lets install php for processing

sudo apt-get install php-fpm php-mysql

Uncomment the follwoing lines in /etc/nginx/sites-available/default

 location ~ \.php$ {

                include snippets/fastcgi-php.conf;


        #       # With php7.0-cgi alone:

        #       fastcgi_pass;

        #       # With php7.0-fpm:

                fastcgi_pass unix:/run/php/php7.0-fpm.sock;



index index.html index.htm index.nginx-debian.html;


index index.php index.html index.htm index.nginx-debian.html;

Restart nginx

service nginx restart

Now your nginx server is ready to execute php script.

Note : If you want to execute sql query through php script then use mysli_query() instead of mysql_auery().


Installing github on ubuntu server

Install github

sudo apt-get install git

Configuring Github :

git config –global “user_name”

git config –global “email_id”

Creating a local repo

git init Sample

If the repository is created successfully, then you will get the following line:

Initialized empty Git repository

Linking a remote repo:

git remote add origin