Après beaucoup de lecture et d'essais , je n'arrive toujours pas à demander une page en php au serveur, il me renvoie une erreur "file not found".
Remarque : si je demande un fichier index.html ça semble fonctionner mais un index.php,non : le navigateur affiche "file not found"
EDIT : je précise que le serveur est dans mon réseau local et que je demande la page via le nom de domaine : nimajneb.eu (et non par l'ip locale)
J'ai lu , entre autre, ce fil : viewtopic.php?p=179905&hilit=php+fpm+nginx#p179905
qui ressemble au souci que je rencontre et qui fait douter sur le paramétrage correct des permissions/utilisateurs ....
Vous trouverez ci-dessous les infos que je pense pertinentes pour vous aider à y voir plus clair ...
Je suis désolé, j'espère que c'est assez digeste
Syntaxe des fichiers de configurations :
Code : Tout sélectionner
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# php-fpm -t
[NOTICE] configuration file /etc/php/php-fpm.conf test is successful
Code : Tout sélectionner
# cat /etc/nginx/sites-enabled/nimajneb.eu
server {
server_name nimajneb.eu;
location / {
root /srv/www/nimajneb.eu;
index index.html index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi.conf;
}
}
Code : Tout sélectionner
$ cat /etc/php/php-fpm.d/nimajneb.eu.conf
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www.nimajneb.eu]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of the child processes. This can be used only if the master
; process running user is root. It is set after the child process is created.
; The user and group can be specified either by their name or by their numeric
; IDs.
; Note: If the user is root, the executable needs to be started with
; --allow-to-run-as-root option to work.
; Default Values: The user is set to master process running user by default.
; If the group is not set, the user's group is used.
user = http
group = http
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
; a specific port;
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /run/php-fpm/php-fpm.sock
;listen = 127.0.0.1:9000
Code : Tout sélectionner
$ ls -la /srv/
total 24
drwxr-xr-x 6 root root 4096 15 nov. 2021 .
drwxr-xr-x 18 root root 4096 29 juil. 13:21 ..
dr-xr-xr-x 4 root root 4096 7 sept. 2022 ftp
drwxr-xr-x 2 root root 4096 11 nov. 2021 http
drwxr-xr-x 2 root root 4096 13 oct. 2021 partage_arch
drwxr-xr-x 3 root root 4096 5 août 17:26 www
$ ls -la /srv/www/nimajneb.eu/
total 24
drwxr-xr-x 3 pegasi http 4096 5 août 18:09 .
drwxr-xr-x 3 root root 4096 5 août 17:26 ..
drwxr-xr-x 2 pegasi pegasi 4096 30 juil. 20:20 images
-rw-r--r-- 1 pegasi pegasi 46 5 août 18:06 index.html.save
-rw-r--r-- 1 pegasi pegasi 43 5 août 16:54 index.php
-rw-r--r-- 1 pegasi pegasi 45 5 août 15:28 index.php~
Code : Tout sélectionner
$ ps -ef | grep php
root 651 1 0 16:59 ? 00:00:00 php-fpm: master process (/etc/php/php-fpm.conf)
http 652 651 0 16:59 ? 00:00:00 php-fpm: pool www.nimajneb.eu
http 653 651 0 16:59 ? 00:00:00 php-fpm: pool www.nimajneb.eu
pegasi 1131 298 0 18:36 pts/0 00:00:00 grep php
$ ps -ef | grep nginx
root 682 1 0 17:01 ? 00:00:00 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;
http 683 682 0 17:01 ? 00:00:00 nginx: worker process
pegasi 1152 298 0 18:39 pts/0 00:00:00 grep nginx
Code : Tout sélectionner
$ ls /run/php-fpm/
php-fpm.sock
J'espère ne pas oublier d'information utile..
Merci par avance pour votre aide, vos conseils,vos remarques ou vos critiques .
51peg_b.