- Install via chocolately
choco install conemu -y
- Install via chocolately
choco install nginx -y
** The-y
argument is to skip any confirmation messages...just install it. It's fine ;)
- Install via chocolately
choco install php -y
- Install via chocolately
choco install mysql -y
- Install via chocolately
choco install mysql.workbench -y
- Install the Composer package manager for PHP
choco install composer -y
choco upgrade chocolatey -y
choco install vscode -y
choco install git -y
IF YOU RECEIVE A DEPENDENCY ERROR - please run choco install git.install -y
choco install smartgit -y
choco install vlc -y
choco install 7zip.install -y
choco install dbeaver -y
C:\tools\nginx-1.17.0\conf
or whichever is the latest version installed Please use the path of the latest version of nginx installed by chocolately
C:\tools\php72
or whichever is the latest version installed
- Un-comment extensions directory
extension_dir = "ext"
- Make sure to enable the following extensions
extension=curl
extension=fileinfo
extension=intl
extension=gd2
extension=odbc
extension=pdo_mysql
extension=pdo_odbc
Download HiddenConsole
Download the following code snippet that will run PHP in the background without needing to have a console/terminal opened.
HiddenConsole - unzip this file into the c:\tools
directory.
Read more on why we want this tool.
We use this .bat file to run PHP-FPM. You can name this file anything you'd like, i.e.: start-php-fcgi.bat
.
Copy the following into that file and make sure to use your PHP CONFIGURATION PATH
@ECHO OFF
ECHO Starting PHP FastCGI...
set PATH=C:\tools\php73\;%PATH%
C:\tools\RunHiddenConsole.exe C:\tools\php73\php-cgi.exe -b 127.0.0.1:9000
Now open a new terminal/prompt and run the following command c:\tools\php73\start-php-fcgi.bat
This will run the required PHP CGI on windows :)
- This is our default nginx configuration. I like to put all servers into a dedicated folder, e.g.:
/servers
# user nobody;
worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}
}
include C:/nginx-1.17.3/conf/servers/*.conf;
}
server {
listen 80;
server_name LOCAL_DOMAIN;
index index.php;
error_log C:/nginx-1.17.3/logs/error.log;
access_log C:/nginx-1.17.3/logs/access.log;
root C:/THE_ROOT_OF_YOUR_PROJECT;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
}
}
- I use CMDer but you can use any terminal. I'd use cmder. It's less suckage.
- Nginx should be running at this point. You can check by visiting http://localhost in your browser of choice.
- Next, let's add nginx to Windows' PATH variables. To do this, open "System Properties" and visit the "Advanced Tab" and click on "Environment Variables" on the bottom right of the window (http://drops.cavscout.us/TSdFDY).
- Next, you'll need to find "Path" variable under "System variables" (http://drops.cavscout.us/vtP5bo) and enter the nginx path which is:
C:\tools\nginx-1.17.0
. - Click 'OK' and you should be all set to use nginx in your terminal.
- You now have the following options to run in the terminal:
nginx -s stop
fast shutdownnginx -s quit
graceful shutdownnginx -s reload
changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processesnginx -s reopen
re-opening log files
- Next, you'll need to create an entry in Windows' hosts file which is located in
C:\Windows\System32\drivers\
.
To generate an SSH key in Windows 7, you'll need to download a console/terminal emulator that has SSH built-in. One of the most widely used emulators for Windows is either Cygwin or Cmder. Let's go with Cmder.
- Download Cmder
- Extract the zip file into your desired directory (I'd keep it at the root of your C: drive - i.e.: C:/Cmder)
This is a mandatory security step from GitHub.
-
Open PowerShell (as admin) and type the following command:
ssh-keygen.exe
You'll be prompted several times. There is no need to do anything other than hitting the enter key until you see ASCII art (a picture of sorts) in the terminal (powershell in this case).
(Make sure vscode is installed)
-
Copy the path generated by ssh-keygen and open it with vscode
code C:\Users\YOUR_USER_PROFILE_NAME\.ssh\id_rsa.pub
.Open the file named
id_rsa.pub
copy the value from the file.Hint: The ssh key should begin with:
ssh-rsa
-
Log into https://github.com/settings/key and click "New SSH Key".
-
Paste your rsa key and click submit/save.
Now you are able to successfully clone any respository from GitHub.