PHP Setup

Restart Nginx Server

taskkill /F /IM nginx.exe
timeout /t 2
F:\4Born-Server-setup\Setup\nginx-1.25.3\nginx.exe
&
F:\4Born-Server-setup\Setup\nginx-1.25.3\nginx.exe -s reload 

nginx -s reload
            

Restart PHP FastCGI

taskkill /F /IM php-cgi.exe
timeout /t 2
start /B "PHP FastCGI" "F:\4Born-Server-setup\Setup\php-8.3.19\php-cgi.exe" -b 127.0.0.1:9000
            

Terminate Nginx and PHP FastCGI at the Same Time

taskkill /F /IM nginx.exe
taskkill /F /IM php-cgi.exe
            

Port Already Used Problem Solve

netstat -ano | findstr :111 (port)

taskkill /PID  /F
taskkill /PID 12345 /F
            

Steps to Add Another Port in Nginx

If you need to add another application running on a new port in Nginx, follow these steps:

  1. Open the Nginx configuration file located at:
  2. F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf
  3. Add a new server block for the desired port:
  4.     # ✅ PHP Application on Port 5698 (Web) repalce web to your directory path 
        server {
            listen 5698;
            server_name localhost;
            root F:/4Born-Server-setup/Time-Tracker/web;
            index index.php index.html index.htm;
    
            location / {
                try_files $uri $uri/ /index.php?$query_string;
            }
    
            location ~ \.php$ {
                include fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME F:/4Born-Server-setup/Time-Tracker/web$fastcgi_script_name;
            }
        }
    
                    
  5. Save the configuration file.
  6. Restart Nginx using the restart command above.
  7. Test by visiting http://127.0.0.1:5698 in your browser.

Open File Manager at Setup Directory

explorer F:\4Born-Server-setup
            

MySQL Commands

mysql -u root -p
SHOW DATABASES;
USE your_database;
SHOW TABLES;