article:installation_nginx_php_cgi_debian
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| article:installation_nginx_php_cgi_debian [2026/02/02 09:15] – estro | article:installation_nginx_php_cgi_debian [2026/02/03 07:20] (Version actuelle) – estro | ||
|---|---|---|---|
| Ligne 2: | Ligne 2: | ||
| [[./ | [[./ | ||
| ---- | ---- | ||
| + | [[https:// | ||
| <code bash> | <code bash> | ||
| 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 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 | ||
| Ligne 7: | Ligne 8: | ||
| sudo systemctl status nginx | sudo systemctl status nginx | ||
| sudo apt install fcgiwrap | sudo apt install fcgiwrap | ||
| + | |||
| + | sudo nano / | ||
| + | </ | ||
| + | * <code bash> | ||
| + | location /cgi-bin/ { | ||
| + | # Disable gzip (it makes scripts feel slower since they have to complete | ||
| + | # before getting gzipped) | ||
| + | gzip off; | ||
| + | |||
| + | # Set the root to /usr/lib (inside this location this means that we are | ||
| + | # giving access to the files under / | ||
| + | root /usr/lib; | ||
| + | |||
| + | # Fastcgi socket | ||
| + | fastcgi_pass | ||
| + | |||
| + | # Fastcgi parameters, include the standard ones | ||
| + | include / | ||
| + | |||
| + | # Adjust non standard parameters (SCRIPT_FILENAME) | ||
| + | fastcgi_param SCRIPT_FILENAME | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| sudo systemctl enable fcgiwrap | sudo systemctl enable fcgiwrap | ||
| sudo systemctl start fcgiwrap | sudo systemctl start fcgiwrap | ||
| sudo systemctl status fcgiwrap | sudo systemctl status fcgiwrap | ||
| - | ajouter dans le fichier du site où un appel à un cgi est souhaité | + | sudo nano / |
| - | exemple | + | # ajouter dans le fichier du site où un appel à un cgi est souhaité |
| - | | + | # exemple |
| + | </code> | ||
| + | * <code bash> | ||
| ## Trun on /cgi-bin/ support to run CGI apps ## | ## Trun on /cgi-bin/ support to run CGI apps ## | ||
| include / | include / | ||
| + | </ | ||
| + | <code bash> | ||
| sudo nginx -t | sudo nginx -t | ||
| sudo nginx -s reload | sudo nginx -s reload | ||
| sudo mkdir -vp / | sudo mkdir -vp / | ||
| - | sudo nano / | + | sudo nano / |
| - | # | + | </ |
| - | echo " | + | * <code bash> |
| - | | + | # |
| - | now="$(date)" | + | # ___________________________________________________________________ |
| - | echo '< | + | # |
| - | echo '< | + | # fichier exemple : / |
| - | + | # ___________________________________________________________________ | |
| - | | + | |
| - | | + | echo "\ |
| - | | + | Content-type: |
| - | echo '</ | + | |
| - | echo '</ | + | < |
| - | sudo chmod +x -v / | + | <html lang="fr"> |
| + | < | ||
| + | <meta charset="UTF-8"> | ||
| + | < | ||
| + | | ||
| + | < | ||
| + | <h2>Premier script CGI !</ | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | sudo chmod +x -v / | ||
| + | # Test dans firefox | ||
| + | # http:// | ||
| </ | </ | ||
article/installation_nginx_php_cgi_debian.1770023707.txt.gz · Dernière modification : de estro
