/*
http://nginx.org/en/download.html
http://nginx.org/en/docs/windows.html (read #1)
cd c:\
unzip nginx-1.21.1.zip
cd nginx-1.21.1
start nginx
C:\nginx-1.21.1>tasklist /fi "imagename eq nginx.exe"
Image Name PID Session Name Session# Mem Usage
=============== ======== ============== ========== ============
nginx.exe 652 Console 0 2 780 K
nginx.exe 1332 Console 0 3 112 K
access_log E:\_pub\nginx-1.21.1\logs\access.log;
root E:\_pub\nginx-1.21.1\html;
nginx -s stop fast shutdown
nginx -s quit graceful shutdown
nginx -s reload changing configuration
nginx -s reopen re-opening log files
https://codefaq.org/server/how-to-install-nginx-php-mysql-on-windows-10/ (read #2)
C:\xampp7\php
C:\xampp7\mysql
download https://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip
unzip in E:\_pub\nginx-1.21.1>
E:\_pub\nginx-1.21.1> dir runhiddenconsole.exe
E:\_pub\nginx-1.21.1> nginx -v
nginx version: nginx/1.21.1
E:\_pub\nginx-1.21.1> C:\xampp7\php\php.exe -v
PHP 7.2.26 (cli) (built: Dec 17 2019 15:29:10) ( ZTS MSVC15 (Visual C++ 2017) x64 )
E:\_pub\nginx-1.21.1> C:\xampp7\mysql\bin\mysqld.exe -V
C:\xampp7\mysql\bin\mysqld.exe Ver 10.4.11-MariaDB for Win64 on AMD64 (mariadb.org binary distribution)
E:\_pub\nginx-1.21.1> notepad conf/nginx.conf
old
location / {
root html;
index index.html index.htm;
}
new
location / {
root html;
index index.php index.html index.htm;
}
create new
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
E:\_pub\nginx-1.21.1> runhiddenconsole C:\xampp7\php\php-cgi -b 127.0.0.1:9000
E:\_pub\nginx-1.21.1> nginx
E:\_pub\nginx-1.21.1> nginx -s reload
E:\_pub\nginx-1.21.1> nginx -s reopen
C:\xampp7\> mysql_start.bat
C:\xampp7\> netstat -na | findstr 3306
C:\xampp7\> C:\xampp7\mysql\bin\mysql -u root -p
MariaDB [(none)]> show databases;
MariaDB [(none)]> exit;
E:\_pub\nginx-1.21.1> notepad html\index.php
<?php
echo "PHP works!";
$servername = "localhost";
$username = "root";
$password = "";
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected to MYSQL successfully";
phpinfo();
?>
explorer http://127.0.0.1/
*/