Welcome! Log In Create A New Profile

Advanced

index.php loading empty content 200 ok

Posted by Anointedone 
index.php loading empty content 200 ok
May 01, 2019 01:15PM
Hi there,

I am running latest version of Nginx and php-fpm with MariaDB. I can open test.php <?php var_export($_SERVER)?>

and phpinfo.php from the webroot location. But the index.php won't load. Its a blank page with no errors.

Error log shows. status 200 ok. My config.con is fine which is why the test and phpinfo load. Its just the index.php.

Its similar to description below:
The SCRIPT_FILENAME parameter is required as it is passed to PHP FPM to determine the script name.

In the builds of NGINX for a lot of Linux distributions, this parameter has been added in fastcgi_params file, i.e. /etc/nginx/fastcgi_params``so the users could import all the CGI params via the ``include directive, i.e. include fastcgi_params . But for some distributions, such as CentOS, this parameter does not exist in fastcgi_params file.

If this parameter is not set, PHP FPM responses 200 OK with empty content, and there is no error or warning. For more informaton about the CGI params, please refer to nginx beginners guide, $_SERVER in PHP and RFC3875.

If you see a blank page in browser, please check if SCRIPT_FILENAME parameter is set.

This guide run fine on php.ini with cgi.fix_pathinfo = 1 (the default).

Some guide insist to change it to cgi.fix_pathinfo = 0 but doing that make PHP_SELF variable broken (not equal to DOCUMENT_URI).
https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 80
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready