Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

135
Visualizações
phpinfo only displays a blank page on nginx

I'm currently learning Nginx, and trying to get phpinfo to be displayed. But it only displays a blank page like this. phpinfo blank

The below is what I have made sure / tried so far.

  • php socket is at the correct location
find / -name *fpm.sock
/run/php/php7.4-fpm.sock
  • php file has been created properly
root@nginx-fundamentals:/sites/demo# cat info.php
<?php phpinfo(); ?>
  • the user for nginx process is the same as the one for php
root@nginx-fundamentals:~# ps aux | grep nginx
root        1056  0.0  0.3   8720  3212 ?        Ss   Jun20   0:00 nginx: master process /usr/sbin/nginx
www-data  104677  0.0  0.3   9140  3684 ?        S    Jul06   0:00 nginx: worker process
root      112008  0.0  0.2   8160  2496 pts/0    S+   04:03   0:00 grep --color=auto nginx
root@nginx-fundamentals:~# ps aux | grep php
root       11018  0.0  1.0 195484 10496 ?        Ss   Jun21   1:52 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
www-data   11020  0.0  0.4 195872  4756 ?        S    Jun21   0:00 php-fpm: pool www
www-data   11021  0.0  0.4 195872  4756 ?        S    Jun21   0:00 php-fpm: pool www
root      112010  0.0  0.0   8160   736 pts/0    S+   04:03   0:00 grep --color=auto php
  • the content of the conf file should be fine
root@nginx-fundamentals:/etc/nginx# cat nginx.conf
user www-data;
events {}
 
http {
    include mime.types;
    server {
 
      listen 80;
      server_name XX.XXX.XXX.117;
 
      root /sites/demo;
      index index.php index.html;
 
      location / {
        try_files $uri $uri/ =404;
      }
 
      location ~\.phps$ {
        # Pass php requests to the php-fps service (fastcgi)
        include fastcgi.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
      }
    }
}
  • When the path is not specified, it displays the default page. Default page

What am I doing wrong? What else should I investigate?

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda