Comments on How to Install Nginx with PHP and MySQL (LEMP Stack) on Ubuntu 18.04

This tutorial shows how you can install Nginx on an Ubuntu 18.04 LTS server with PHP 7.2 support (through PHP-FPM) and MySQL support (LEMP = Linux + nginx (pronounced "engine x") + MySQL + PHP).

9 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anik Rahman

Great article. :D You can explain how virtual nginx server works.

By: C4

Hi, please I'm getting 502 Bad Gatway error on the info.php page, I followed your steps exactly as you've written, any ideas what might be wrong? Otherwise, thank you for the article!

By: Husnain

I have followed the same steps and everything is working fine. But getting 502 bad gateway error. It is due to the php7.2-fpm. Nginx is looking for php7.0-fpm but We have assigned 7.2.

I am trying to figure out where the issue is arising. If anyone know, please help

By: bartek

@Husnain

when you edit sites-available/default. Uncomment the PHP line shown below and change the sock file line.

Make sure it is php7.2-fpm and not php7.0-fpm on line:

fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;

By: Tadeusz

Hi, after logging in to phpmyadmin I have no pictures.

eg logo: 

http://www.my_domain.xyz/phpmyadmin/themes/pmahomme/img/logo_left.png = 404 not found. 

Can you help me how to fix that? 

By: Tadeusz

Fix phpmyadmin if no showing pitures and icons: 

location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { root /usr/share/; }

By: user

Thx a lot

By: Mutia

Thank you, it's works! God Bless You!

By: Matt

Hi, I get this error whenever I don't comment out the two include lines in the .conf. Does anyone know why this is or have it themselves? I'm running Ubuntu 18.04 and have followed this to the T, can't figure out whats wrong.

 

"nginx: [emerg] open() "/etc/nginx/snippets/fastcgi-php.conf" failed (2: No such file or directory) in /etc/nginx/conf.d/blueberrypollbois.com.conf:63

nginx: configuration file /etc/nginx/nginx.conf test failed"