Welcome! Log In Create A New Profile

Advanced

Unknown: Filename cannot be empty

Posted by Neves 
Neves
Unknown: Filename cannot be empty
July 02, 2009 12:29AM
Jason
Re: Unknown: Filename cannot be empty
July 02, 2009 09:13AM
Make sure your $document_root$fastcgi_script_name; has a slash either
at the end or beginning of one of the names.
I personally like to leave OUT the trailing slash and add it via the
fastcgi_param like so:
$document_root/$fastcgi_script_name;

I think it would be more useful if you pasted your config. Paste-
bin? Feel free to sanitize it.

Just for the heck of it (just to rule it out, do it anyway): chmod
777 -R [path in question which contains your files]
After everything is fine change it back to the original perm sets.
Notice the -R so if you have a nested permission set take note of it.
Or you could tar the whole lot and untar to restore with full orig
perms.

Try your files out again.


On Jul 2, 12:29
Neves
Re: Unknown: Filename cannot be empty
July 02, 2009 02:00PM
I change the parameter to a constant file like this:
fastcgi_param SCRIPT_FILENAME /qi/www/localhost/index.php;
and it works. So the problema was with the nginx location that was
generating the $document_root

To help anothers with nginx debugging with php, I would like to share
a configuration that I create:

fastcgi_param DEBUG "uri=$uri request_uri=$request_uri
request_filename=$request_filename query_string=$query_string is_args=
$is_args document_uri=$document_uri document_root=$document_root args=
$args fastcgi_script_name=$fastcgi_script_name";

After putting that on your nginx config, try this on your php script:

echo $_SERVER["DEBUG"]; // will print all nginx variables so you can
play with nginx regexp, etc.

thanks for helping.

On Jul 2, 10:13
Re: Unknown: Filename cannot be empty
July 02, 2009 02:39PM
That DEBUG idea is pretty neat.

$document_root should work, but if you're using an aliased location or
something else it will be different.

On Thu, Jul 2, 2009 at 11:00 AM, Neves<marcos.neves@gmail.com> wrote:
>
> I change the parameter to a constant file like this:
> fastcgi_param  SCRIPT_FILENAME    /qi/www/localhost/index.php;
> and it works. So the problema was with the nginx location that was
> generating the $document_root
>
> To help anothers with nginx debugging with php, I would like to share
> a configuration that I create:
>
> fastcgi_param DEBUG "uri=$uri request_uri=$request_uri
> request_filename=$request_filename query_string=$query_string is_args=
> $is_args document_uri=$document_uri document_root=$document_root args=
> $args fastcgi_script_name=$fastcgi_script_name";
>
> After putting that on your nginx config, try this on your php script:
>
> echo $_SERVER["DEBUG"]; // will print all nginx variables so you can
> play with nginx regexp, etc.
>
> thanks for helping.
>
> On Jul 2, 10:13 am, Jason <jason.giedy...@gmail.com> wrote:
>> Make sure your $document_root$fastcgi_script_name; has a slash either
>> at the end or beginning of one of the names.
>> I personally like to leave OUT the trailing slash and add it via the
>> fastcgi_param like so:
>>   $document_root/$fastcgi_script_name;
>>
>> I think it would be more useful if you pasted your config.  Paste-
>> bin?  Feel free to sanitize it.
>>
>> Just for the heck of it (just to rule it out, do it anyway):  chmod
>> 777 -R [path in question which contains your files]
>> After everything is fine change it back to the original perm sets.
>> Notice the -R so if you have a nested permission set take note of it.
>> Or you could tar the whole lot and untar to restore with full orig
>> perms.
>>
>> Try your files out again.
>>
>> On Jul 2, 12:29 am, Neves <marcos.ne...@gmail.com> wrote:
>>
>> > I´ve already configured nginx+php-fpm+php-5.3.0-beta with success.
>> > Now, I´m trying again but getting the follow error while accessing a
>> > page:
>>
>> > Unknown: Filename cannot be empty in <b>Unknown</b> on line <b>0</
>> > b><br />
>>
>> > It looks like php-cgi is not getting the php-script path correctly, am
>> > I right?
>>
>> > its not file permission the problem. I am using this php-fpm
>> > configuration:
>>
>> > fastcgi_pass   127.0.0.1:9000;
>> > fastcgi_index  index.php;
>> > fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
>> > fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
>> > fastcgi_param  QUERY_STRING       $query_string;
>> > fastcgi_param  REQUEST_METHOD     $request_method;
>> > fastcgi_param  CONTENT_TYPE       $content_type;
>> > fastcgi_param  CONTENT_LENGTH     $content_length;
>> > fastcgi_param  REQUEST_URI        $request_uri;
>> > fastcgi_param  DOCUMENT_URI       $document_uri;
>> > fastcgi_param  DOCUMENT_ROOT      $document_root;
>> > fastcgi_param  SERVER_PROTOCOL    $server_protocol;
>> > fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
>> > fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
>> > fastcgi_param  REMOTE_ADDR        $remote_addr;
>> > fastcgi_param  REMOTE_PORT        $remote_port;
>> > fastcgi_param  SERVER_ADDR        $server_addr;
>> > fastcgi_param  SERVER_PORT        $server_port;
>> > fastcgi_param  SERVER_NAME        $server_name;
>> > # PHP only, required if PHP was built with --enable-force-cgi-redirect
>> > fastcgi_param  REDIRECT_STATUS    200;
>>
>> > php-fpm configuration is standard, with user/group defined to www-
>> > data:www-data
>>
>>
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 232
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