Outils pour utilisateurs

Outils du site


article:installation_nginx_php_cgi_debian

Ceci est une ancienne révision du document !


Installation nginx + php + cgi (Debian)

Retour


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 systemctl enable fcgiwrap
sudo systemctl start fcgiwrap
sudo systemctl status fcgiwrap
 
ajouter dans le fichier du site où un appel à un cgi est souhaité
exemple dans  /etc/nginx/sites-enabled/default
 
        ## Trun on /cgi-bin/ support to run CGI apps ##
        include /etc/nginx/fcgiwrap.conf;
 
sudo nginx -t
sudo nginx -s reload
sudo mkdir -vp /usr/lib/cgi-bin
sudo nano /usr/lib/cgi-bin/hello.cgi 
        #!/usr/bin/env bash
        echo "Content-type: text/html"
        echo ""
        now="$(date)"
        echo '<html><head><title>Hello World - CGI app</title></head>'
        echo '<body>'
 
        echo '<h2>Hello World!</h2>'
        echo "Computer name : $HOSTNAME<br/>"
        echo "The current date and time : ${now}<br/>"
        echo '</body>'
        echo '</html>'
        sudo chmod +x -v /usr/lib/cgi-bin/hello.cgi
article/installation_nginx_php_cgi_debian.1770023707.txt.gz · Dernière modification : de estro

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki