taskkill /F /IM nginx.exe
timeout /t 2
nginx -s reload
taskkill /F /IM php-cgi.exe
timeout /t 2
Start-Process "F:\Server\Setup\php-8.2.29\php-cgi.exe" -ArgumentList "-b 127.0.0.1:9000"
taskkill /F /IM nginx.exe
taskkill /F /IM php-cgi.exe
netstat -ano | findstr :111 (port) taskkill /PID/F taskkill /PID 12345 /F
sudo systemctl stop nginx
sudo systemctl start nginx
# Or restart in one command:
sudo systemctl restart nginx
# Reload configuration without stopping:
sudo nginx -s reload
sudo systemctl stop php8.3-fpm
sudo systemctl start php8.3-fpm
# Or restart in one command:
sudo systemctl restart php8.3-fpm
# Check PHP-FPM status:
sudo systemctl status php8.3-fpm
sudo systemctl stop nginx php8.3-fpm
# Or kill processes:
sudo pkill nginx
sudo pkill php-fpm
# Check what's using port 80 (or any port): sudo netstat -tulpn | grep :80 # Or using ss command: sudo ss -tulpn | grep :80 # Kill process by PID: sudo kill -9sudo kill -9 12345 # Kill process by name: sudo pkill nginx
If you need to add another application running on a new port in Nginx, follow these steps:
F:\4Born-Server-setup\Setup\nginx-1.25.3\conf\nginx.conf
# ✅ PHP Application on Port 5698 (Web) replace 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;
}
}
sudo nano /etc/nginx/sites-available/default # Or create a new site: sudo nano /etc/nginx/sites-available/myapp
# ✅ PHP Application on Port 5698
server {
listen 5698;
server_name localhost;
root /home/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 snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
}
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo nginx -t sudo systemctl restart nginx
explorer F:\4Born-Server-setup
cd /home/4Born-Server-Setup
# Open file manager:
nautilus /home/4Born-Server-Setup
# List directory contents:
ls -la /home/4Born-Server-Setup
Note: MySQL commands are identical on both Windows and Linux systems.
mysql -u root -p
SHOW DATABASES;
USE your_database;
SHOW TABLES;
DESCRIBE table_name;
SELECT * FROM table_name LIMIT 10;
# Install PHP and extensions:
sudo apt update
sudo apt install php8.3 php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-mbstring
# Check PHP version:
php -v
# Check PHP-FPM configuration:
sudo php-fpm8.3 -t
# View PHP configuration:
php --ini
# View Nginx error logs:
sudo tail -f /var/log/nginx/error.log
# View PHP-FPM logs:
sudo tail -f /var/log/php8.3-fpm.log
# View system logs:
sudo journalctl -u nginx -f
sudo journalctl -u php8.3-fpm -f