Welcome! Log In Create A New Profile

Advanced

Re: why my php file in subdirectory doesn't work?

Simon Liu
September 27, 2011 11:04PM
Hello.

You shoude set (fastcgi_param SCRIPT_FILENAME) .

example:
location ~ .*\.(php|php5)?$
{
fastcgi_param SCRIPT_FILENAME /data/web/$1;

}


On Wed, Sep 28, 2011 at 10:56 AM, baalchina <nginx-forum@nginx.us> wrote:

> Hello everyone,
>
> I am working on an centos6 with nginx 1.0.6, php 5.3.6, and fpm.
>
> I found that php file in my subdirectory returns a 404,but in nginx home
> direcory works fine.
>
> For example , a phpinfo.php file works fine in /data/web/, where
> /data/web is my nginx document root. Buy the same file in /data/web/sub,
> the browser and nginx both tell a 404 error.
>
> Here is my nginx config file:
>
>
> server {
> listen 80;
> server_name abc.example.com;
>
> location / {
> root /data/web/;
> index index.html index.htm index.php;
>
> location ~ .*\.(php|php5)?$
> {
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_index index.php;
> include fastcgi.conf;
> fastcgi_connect_timeout 300;
> fastcgi_send_timeout 300;
> fastcgi_read_timeout 300;
> fastcgi_buffer_size 64k;
> fastcgi_buffers 4 64;
> fastcgi_busy_buffers_size 128k;
> fastcgi_temp_file_write_size 128k;
> }
> }
> }
>
>
> btw, static file such as html works fine.
>
> Thans a lot.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,215921,215921#msg-215921
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx




--
douban:www.douban.com/people/mustang/

blog: www.pagefault.info

twitter: www.twitter.com/minibobo

weibo: www.weibo.com/diaoliang
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

why my php file in subdirectory doesn't work?

baalchina September 27, 2011 10:56PM

Re: why my php file in subdirectory doesn't work?

Simon Liu September 27, 2011 11:04PM

Re: why my php file in subdirectory doesn't work?

suttles October 11, 2011 10:53AM

Re: why my php file in subdirectory doesn't work?

Simon Liu October 11, 2011 11:18AM

Re: why my php file in subdirectory doesn't work?

suttles October 11, 2011 11:21AM

Re: why my php file in subdirectory doesn't work?

Simon Liu October 11, 2011 11:42PM

Re: why my php file in subdirectory doesn't work?

suttles October 12, 2011 02:19PM

Re: why my php file in subdirectory doesn't work?

suttles October 17, 2011 12:19PM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 02:37AM

Re: why my php file in subdirectory doesn't work?

hobson42 January 06, 2012 05:32AM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 06:39AM

Re: why my php file in subdirectory doesn't work?

Edho Arief January 06, 2012 06:42AM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 07:26AM

Re: why my php file in subdirectory doesn't work?

Edho Arief January 06, 2012 07:50AM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 08:46AM

Re: why my php file in subdirectory doesn't work?

Edho Arief January 06, 2012 08:50AM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 09:01AM

Re: why my php file in subdirectory doesn't work?

Edho Arief January 06, 2012 09:08AM

Re: why my php file in subdirectory doesn't work?

gigabyte January 06, 2012 09:23AM

Re: why my php file in subdirectory doesn't work?

Edho Arief January 06, 2012 05:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 320
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready