lua-nginx-module icon indicating copy to clipboard operation
lua-nginx-module copied to clipboard

Can't read PHP file

Open sintyasin opened this issue 4 years ago • 2 comments

I'm trying to load index.php file which have code like die('something'); But it doesn't show 'something' when i try to load the page. When i turn on nginx service, it runs well. But when i turn openresty, it shows blank page.

I tried to debug it and write a index.html file and it runs well on both nginx and openresty.

Why the index.php is not working when i use openresty?? Any help would be appreciate, thannk you.

sintyasin avatar Sep 23 '21 06:09 sintyasin

better to pate the nginx.conf for reproducing the problem

zhuizhuhaomeng avatar Sep 23 '21 07:09 zhuizhuhaomeng

STEP1: #index.html normal configuration location / { index index.php index.html index.htm; }

#index.php you should configure like this location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }

netstat -anp| grep nginx tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 15923/nginx

STEP2: PHP-FPM (FastCGI Process Manager) is an alternative FastCGI implementation for PHP Make sure it is installed and turned on.

netstat -anp| grep php-fpm tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 6526/php-fpm

GumpSun avatar Feb 21 '22 03:02 GumpSun