Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

238
Views
Configuración nginx 1.18 con php-fpm7.4

Quiero ejecutar php bajo nginx, tengo algunas dificultades. Ya casi termino, sin embargo, tengo un error 502, no sé por qué.

Tengo Nginx 1.18, php 7.4.x con fpm. Creé un archivo php en: /usr/share/nginx/html/info.php, sin embargo, cuando estoy en él, tengo un error 502. Aquí está el archivo que tengo para la configuración predeterminada:

servidor {

 listen 80; root /usr/share/nginx/html; index index.php index.html index.htm index.nginx-debian.html; server_name localhost; location / { try_files $uri $uri/ =404; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; } location ~ /\.ht { deny all; }

}

He visto esta línea en algunos casos, sin embargo, cuando hago "nginx -t" falla.

incluir fragmentos / fastcgi-php.conf;

Miré cuidadosamente, todo funciona localmente, todo funciona. No comprendo.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

En su publicación anterior, tiene server_name example.com. Compruebe si tiene el nombre de servidor correcto allí. Además, asegúrese de que su servidor de aplicaciones se esté ejecutando porque nginx no puede llegar, por eso está viendo 502

over 4 years ago · Santiago Trujillo Report

0

El problema es tener más de 1 archivo de configuración en /etc/php/7.4/fpm/pool.d

 usr@server:/etc/php/7.4/fpm/pool.d$ ls www.conf foor-php-fpm.conf bar-php-fpm.conf.bak

Solución

Paso 1: elimine o cambie el nombre de cualquier otro archivo .conf y deje solo www.conf

 usr@server:/etc/php/7.4/fpm/pool.d$ sudo mv other-php-fpm.conf other-php-fpm.conf.bak2

Paso 2: systemctl restart php7.4-fpm.service

¡Hecho!

 user@server:~$ systemctl status php7.4-fpm.service ● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2020-12-31 16:16:22 UTC; 6s ago Docs: man:php-fpm7.4(8) Process: 381508 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS) Main PID: 381487 (php-fpm7.4) Status: "Ready to handle connections" Tasks: 3 (limit: 4568) Memory: 12.1M CGroup: /system.slice/php7.4-fpm.service ├─381487 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf) ├─381506 php-fpm: pool www └─381507 php-fpm: pool www

Esta solución también se aplica a php-fpm-7.2.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!