LEMP - Magento displays blank page - php

Trying to setup Magento2 on my LEMP stack. Was following the instructions here and here (did that after compiling from sources for multiple time since it was hard to fulfill composer requirements for Magento2)
Installed composer
Configured and run php, php-fpm
Did some trivial tests (success)
However, a blank screen is all I get. The nginx configuration
server {
listen 2000;
root /usr/share/nginx/html/magento2;
index index.php;
location / {
try_files $uri $uri/ /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;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}
}
The permission set is to -R 777 (test purpose only), user and group is www-data. Was able to run .php scripts, problem applies to Magento2.
Read also some related issues (without any positive results) :
Nginx configuration with Magento 1.8
ngix and php5-fpm blank page

The above query is incomplete the nginx configuration.
Please use the below link configuration of nginx.
http://gotechnies.com/magento2-lemp-nginx-ubuntu/

Related

NGINX doesn't load css files (wordpress implementation)

I am currently trying to implement a wordpress on a sub-domain using nginx.
I've installed all the dependencies (php 7.2, mariadb, mysql) and configured it all.
When I try to access to the website, here is what I got :
To be more explicit: here's what I did to configure nginx in order to use wordpress:
sudo nano /etc/nginx/conf.d/location.conf
server{
server_name subdomain.domain.fr;
root /home/domain/wordpress/;
location / {
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
include fastcgi_params;
index index.php index.html index.htm;
try_files $uri $uri/ =404;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
}
}
My problem is that when I first use a wordpress website, I'm used to see some CSS on the page. When I inspect this page, I can see that the css files are included, but not used. I dont understand why. I think I have a privilege issue or anything else, but it's my first time using nginx with wordpress so I must have done something wrong:
Thanks for your help
I've found a solution that works perfectly:
adding this solved all my problems :
location ~* \.(?:css|js|map|jpe?g|gif|png)$ { }
Thanks for your help

Debian Nginx and PHP Processor

I know there is so much documentation about this but i can't understand where is the problem.
I have fresh installation of Debian 8 and the first think I install is Nginx fastcgi.
Nginx is working but it can't execute any php file.
i have tried some combination of section location ~ .php$ of nginx configuration file but when i try to load .php file from beowser it's just downloaded. There is the last try;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
#include snippets/fastcgi-php.conf;
}
where could be the problem?
Thx all
What do you mean by nothing work? If you get a error of type 500, then it may come from your nginx configuration. However if it is just that your php is not executed, it means that php-fpm service may not be running.

How do I install other applications alongside Laravel?

I'm building a website in Laravel 5.2 and rather than building a forum from scratch, I wish to install one such as SMF.
Laravel is currently in the root directory of my web server and I wish to keep it there as I wish to install SMF in a folder.
For example: www.example.com/smf
I'm thinking to install it in Laravel's /public folder but I'm afraid they will they conflict with each other. Is the /publicfolder the correct place to install SMF and should I use a route to point to the SMF folder?
Server: D.O droplet via Laravel Forge
You need to add custom rules for the folder(s) you want to use before Laravel related rules:
location /smf/index.php(/.*)?$ {
fastcgi_split_path_info ^(/smf/index.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 1000;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
location /smf/ {
if (!-e $request_filename) {
rewrite ^.*$ /smf/index.php last;
}
try_files $uri $uri/ smf/index.php?args;
}
Please look for sample nginx config file here.
You could use Nginx to redirect www.example.com/smf to your SMF installation. To do so add this to your server block:
location /smf {
# nginx will concatenate the string above with the root value
# so your SMF files should be in "/path/to/smf/parent/dir/smf".
# Make sure that Nginx can access them.
root "/path/to/smf/parent/dir";
# change this config to suit your needs
index index.php index.html index.htm;
location ~ \.php$ {
# Here use the same config from the server block that allows you
# to execute PHP scripts
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
A couple of things I should add:
Backup the config file before editing them.
Although I've tried the code above (and it works on my machineā„¢) I must say that I'm not an Nginx expert.

Starting wordpress on nginx debian server

I'm stuck with the installation of Wordpress for Nginx on Debian. The website pointing to my server is mes-affaires.xyz.
Nginx logs are showing 200 responses for any URL from that domain, and appearing all blanks in my browser. That's the difficulty as I'm having no error log of any kind.
Any idea why it's doing this or where I could get a kind of error log?
Now www.mes-affaires.xyz shows nginx default page.
Be sure u got config for your site, and u added it in nginx.conf.
If you are using php-fpm, then you need right setting at server directive. For example:
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
Especially line
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
must have right configuration and causes white blank page in browser when its missconfigured. Also check
$document_root
variable and ofcourse your log files.

Nginx doesn't find Symfony2 routes

I try to run a simple Symfony2 application on a virtual machine. I have Nginx on this VM (generated with PuPHPet and Vagrant), but there's a problem.
When I try to access to the demo route /demo (local.dev/Symfony/web/app_dev.php/demo), Nginx force me to download a file. It seems it works the same way when I specify a random route.
I don't know how to solve this problem, I searched while 2 days for a specific configuration of Nginx but I found nothing. Here is my config file for this Symfony app :
server {
server_name test.dev;
root /var/www/local.dev/Symfony/web;
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app|app_dev|config)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
error_log /var/log/nginx/sf-error.log;
access_log /var/log/nginx/sf-access.log;
}
Thanks for your help.

Categories