Installation nginx + php + cgi (Debian)

Retour


référence cyberciti.biz

sudo apt-get install nginx php8.4-fpm php8.4-gd php8.4-mysql php8.4-curl php8.4-mbstring php8.4-xml php8.4-sqlite3
sudo nginx -v
sudo systemctl status nginx
sudo apt install fcgiwrap
 
sudo nano /etc/nginx/fcgiwrap.conf
sudo systemctl enable fcgiwrap
sudo systemctl start fcgiwrap
sudo systemctl status fcgiwrap
 
sudo nano /etc/nginx/sites-enabled/default
# ajouter dans le fichier du site où un appel à un cgi est souhaité
# exemple :
sudo nginx -t
sudo nginx -s reload
sudo mkdir -vp /usr/lib/cgi-bin
sudo nano /usr/lib/cgi-bin/hello.cgi
sudo chmod +x -v /usr/lib/cgi-bin/hello.cgi
 
# Test dans firefox
# http://localhost/cgi-bin/hello.cgi