How to install NGINX with php and mysql ?, an easiest guide


NGINX pronounced as engine x, is a HTTP server as well as a reverse proxy which can be used as an alternative against apache server. Nowadays i see a lot of websites/web apps running on NGINX. NGINX provide a high performance than apache on websites those have a wide range of users. Which means NGINX can handle pressure without decelerating the performance.

How to install it on your windows machine ?

When i first introduced into NGINX, i didn’t know how. I tried to ask on different online communities but my question didn’t meet their standard, so my question got deleted on asap. But i didn’t quit because i won’t quit until i accomplish. So i had my search and i won. There are two ways to install and configure NGINX.

  1. Download NGINX from official website, download php and mysql seperately and bind it.
  2. Download a stack, like bitnami NGINX stack or WTServer

I prefer the second one. Because starting and running nginx as a service by using the first way is a little complex. So let’s proceed with the second one.

Download and Install WTServer

Using WTServer is the best way to install nginx,php and maria db. I tried bitnami stack but i ended up on WTServer. Now we may proceed with WTServer. Google for WTServer or click here. Install it like any other software. After installing you can start your server by simply double click on the WTServer’s desktop icon.

This slideshow requires JavaScript.

Where is my root directory ?

Usually C:\WTServer\WWW  is the default path for your root directory. You can put your files there and run like in any other servers.

How to config NGINX ?

Just like any other servers you can also configure NGINX. Your NGINX default config file located under C:\WTServer\conf with the name nginx.conf. You can change your root directory there, write your own customized Rewrite URLs there. You don’t have to explicitly configure it for php, because the WTServer already done it for you.

There you go, you have successfully installed NGINX stack on your computer. If you are doing your project with the help of frameworks like CodeIgniter or Laravel, then you have to write custom Rewrite URLs to meet your requirements.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s