Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1369 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs
  Logiciels

  Nginx, C'est bien , quand ca Marche ! (php5-fpm problème)

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Nginx, C'est bien , quand ca Marche ! (php5-fpm problème)

n°1322335
jbdivx
H.264, cay bien !
Posté le 19-10-2012 à 11:06:19  profilanswer
 

Salut tout le monde,

 

je cherche a faire marcher nginx avec php5-fpm, sauf que ca ne veux pas :D

 

Mon Nginx fonctionne avec des index "statiques" (index.html... ect) mais dès que je passe en .php => 403 forbidden et pourtant je pense avoir les accès kivonbien

 

Le fichier : /etc/nginx/sites-enabled/default:

# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts

 

server {

 

listen   80; ## listen for ipv4
 listen   [:]:80 default ipv6only=on; ## listen for ipv6

 

server_name  localhost;

 

access_log  /var/log/nginx/localhost.access.log;

 

location / {
  root   /var/www;
  index  index.html index.htm;
 }

 

location /doc {
  root   /usr/share;
  autoindex on;
  allow 127.0.0.1;
  deny all;
 }

 

location /images {
  root   /usr/share;
  autoindex on;
 }

 

#error_page  404  /404.html;

 

# redirect server error pages to the static page /50x.html
 #
 #error_page   500 502 503 504  /50x.html;
 #location = /50x.html {
 # root   /var/www/nginx-default;
 #}

 

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
 #
 #location ~ \.php$ {
  #proxy_pass   http://127.0.0.1;
 #}

 

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 #
 location ~ \.php$ {
  fastcgi_pass   127.0.0.1:9000;
  fastcgi_index  index.php;
   fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  include fastcgi_params;
 }

 

# deny access to .htaccess files, if Apache's document root
 # concurs with nginx's one
 #
 #location ~ /\.ht {
  #deny  all;
 #}
}

 


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#listen   8000;
#listen   somename:8080;
#server_name  somename  alias  another.alias;

 

#location / {
#root   html;
#index  index.html index.htm;
#}
#}

 


# HTTPS server
#
#server {
#listen   443;
#server_name  localhost;

 

#ssl  on;
#ssl_certificate  cert.pem;
#ssl_certificate_key  cert.key;

 

#ssl_session_timeout  5m;

 

#ssl_protocols  SSLv3 TLSv1;
#ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
#ssl_prefer_server_ciphers   on;

 

#location / {
#root   html;
#index  index.html index.htm;
#}
#}

 

J'ai aussi mon répertoire /var/www en 777 (Caynul je sais :D) en www:data/www:data, et dans ce dossier un fichier index.php

Code :
  1. <?php
  2. phpinfo();
  3. ?>
 

J'ai php5-fpm qui ecoute sur 127.0.0.1:9000

# ps -e | grep php
 3916 ?        00:00:00 php5-fpm
 3917 ?        00:00:00 php5-fpm
 3918 ?        00:00:00 php5-fpm

 

Et mon fichier error.log:


2012/10/19 11:02:45 [error] 3927#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"
2012/10/19 11:02:46 [error] 3927#0: *1 directory index of "/var/www/" is forbidden, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "localhost"
2012/10/19 11:02:46 [error] 3927#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost"

 

J'ai donc du forbidden alors que les permissions sont "larges"

 

# ls -l /var/www
total 8
drwxrwxrwx 13 www-data www-data 4096 23 avril 04:00 cacti
-rwxrwxrwx  1 www-data www-data   20 19 oct.  10:32 index.php

 

Ckoimonproblème ?


Message édité par black_lord le 19-10-2012 à 14:39:24

---------------
La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi. Ici, nous avons réuni théorie et pratique : Rien ne fonctionne... et personne ne sait pourquoi !
mood
Publicité
Posté le 19-10-2012 à 11:06:19  profilanswer
 

n°1322373
Steve2
Posté le 19-10-2012 à 14:01:10  profilanswer
 

Bonjour,
 
Tu réponds toi-même à la question...
essaye avec:

Code :
  1. index  index.html index.htm index.php;


Ca devrait aller mieux comme ça.

n°1322483
jbdivx
H.264, cay bien !
Posté le 20-10-2012 à 00:43:06  profilanswer
 

Salut, merci de ton aide
 
Mais ca ne fonctionne tjrs pas :D
 
J'essaie différent truc, mais le lien entre mon php-fpm et nginx a l'air d'etre NOK
 
J'étais arrivé a faire marché php "classique" avec nginx , mais php-fpm jamais !
 
Peu etre un manque de config quelque part ? (je sui sous débian squeeze)


---------------
La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi. Ici, nous avons réuni théorie et pratique : Rien ne fonctionne... et personne ne sait pourquoi !
n°1322507
deK
watching for beerz on the wing
Posté le 20-10-2012 à 12:01:29  profilanswer
 

La conf type de mes sous-domaines, fonctionnelle avec php5-fpm et NGINX sur une Debian Wheezy à jour :

 

server {
 listen 80;
 server_name monsite.mondomaine.com;
 root /srv/www/monsite;
 location /
  {
  index index.html index.htm index.php;
  }
        location ~ .php$ {
            fastcgi_pass   unix:/var/run/php5-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
}


Message édité par deK le 20-10-2012 à 12:03:01

---------------
Feed HA/V          
n°1322543
jbdivx
H.264, cay bien !
Posté le 20-10-2012 à 19:40:34  profilanswer
 

Merci pour ton aide !
 
J'arrive a faire marcher mon dossier racine maintenant :D ,  
 
J'ai essayé de creer un 2ème serveur avec cacti cette fois, mais la ca marche pas :D
 

Spoiler :

server {
 
 listen   80; ## listen for ipv4
 #listen   [:]:80 default ipv6only=on; ## listen for ipv6
 
 server_name  default;
 root   /var/www;
 
 
 access_log  /var/log/nginx/localhost.access.log;
 
 location / {
  index  index.php index.html index.htm;
 }
 
 location ~ \.php$ {
#  fastcgi_pass   127.0.0.1:9000;
   fastcgi_pass unix:/var/run/php5-fpm.sock;
  fastcgi_index  index.php;
   fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  #fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
  include fastcgi_params;
 }
}
 
 
server {
 
 listen   80; ## listen for ipv4
 #listen   [:]:80 default ipv6only=on; ## listen for ipv6
 
 server_name  cacti;
 root   /var/www/cacti;
 
 
 access_log  /var/log/nginx/localhost.access.log;
 
 location / {
  index  index.php index.html index.htm;
 }
 
 location ~ \.php$ {
#  fastcgi_pass   127.0.0.1:9000;
   fastcgi_pass unix:/var/run/php5-fpm.sock;
  fastcgi_index  index.php;
   fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  #fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
  include fastcgi_params;
 }
 
}
 


 
Quand je charge http://@IP/cacti =>échec de chargement de la page)
 
Le fichier error.log donne:

Spoiler :

2012/10/20 19:40:56 [error] 13040#0: *7 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 192.168.1.89, server: default, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.3"


Message édité par jbdivx le 20-10-2012 à 19:42:02

---------------
La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi. Ici, nous avons réuni théorie et pratique : Rien ne fonctionne... et personne ne sait pourquoi !
n°1322619
Steve2
Posté le 22-10-2012 à 10:09:02  profilanswer
 

D'après ta conf le serveur cacti devrait être accédé par http://cacti/

n°1322987
jbdivx
H.264, cay bien !
Posté le 25-10-2012 à 16:54:32  profilanswer
 

Je vais regarder ca , merci
 
et désolé de ma réponse tardive


---------------
La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi. Ici, nous avons réuni théorie et pratique : Rien ne fonctionne... et personne ne sait pourquoi !
n°1323132
jbdivx
H.264, cay bien !
Posté le 27-10-2012 à 10:22:50  profilanswer
 

Ca commence vraiment à me rendre fou nginx :D
 
 
Ma conf qui marche pas :  
 
Les droits sur les dossiers sont ok , avec le dossier cacti qui se trouve bien à /var/www/cacti
 
(Mes tests php ok était ok avec un fichier index.php dans /var/www), donc le php-fpm n'est pas en cause
 

Spoiler :


server {  
 
 listen   80; ## listen for ipv4  
 #listen   [:]:80 default ipv6only=on; ## listen for ipv6  
 
 server_name  default;  
 
 
 
 access_log  /var/log/nginx/localhost.access.log;  
 
 location / {  
 root   /var/www/cacti;  
  index  index.php index.html index.htm;  
 }  
 
 
 location ~ \.php$ {  
    fastcgi_pass unix:/var/run/php5-fpm.sock;  
  fastcgi_index  index.php;  
   #fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;  
  fastcgi_param  SCRIPT_FILENAME  /var/www/cacti$fastcgi_script_name;  
  include fastcgi_params;  
 }  
}  
 


 
Lorsque je tente : http://@ip_nginx
 

Spoiler :


2012/10/27 10:22:04 [error] 2045#0: *1 directory index of "/var/www/cacti/" is forbidden, client: 192.168.1.163, server: default, request: "GET / HTTP/1.1", host: "192.168.1.164"


 
Steve2 => j'accède pas non plus a mon cacti avec http://cacti avec la conf que j'ai posté juste avant


Message édité par jbdivx le 27-10-2012 à 10:26:02

---------------
La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi. Ici, nous avons réuni théorie et pratique : Rien ne fonctionne... et personne ne sait pourquoi !

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs
  Logiciels

  Nginx, C'est bien , quand ca Marche ! (php5-fpm problème)

 

Sujets relatifs
Problème d'un Linux dans un Linux dans une session RDPProblème de résolution netbios avec Samba
Problème écran LVDS Linuxprobleme de configuration squid3 et squidGuard sous debian squeeze
Probleme ouverture machine virtuel virtualboxDebian... Problème root & réseau.
Firefox/Gtk sous FreeBSD probleme de renduProblème de PROMPT_COMMAND
Probleme LinuxProblème d'imprimantes qui se désactivent toutes seules
Plus de sujets relatifs à : Nginx, C'est bien , quand ca Marche ! (php5-fpm problème)


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR