Project

General

Profile

Default-type allways PHP

Added by francisco over 14 years ago

hi!

I'm trying to make lighttpd assume default-type for ALL pages without extension as being PHP.

Example:
lets say I have a script named "index"

So, when I access: http://www.mysite.com/index/testparam=testing

I would like to have "index" being executed as a PHP script.

Another example: http://www.mysite.com/something/dothis/etc
And let's say: "something" is a "folder" and "dothis" is my PHP script and "etc" could be a parameter.

When I used config below it worked, BUT lighttpd "thinks" that ALL requests are PHP ones, even those with ".jpg" extension :-(

//fastcgi.server           = ( ".php" =>
fastcgi.server             = ( "" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/var/run/lighttpd/php-fastcgi.socket",
                                   "bin-path" => "/usr/local/bin/php-cgi",
                                   "max-procs"         => 1,
                                   "idle-timeout"      => 20,
                                   "bin-environment" => (
                                                "PHP_FCGI_CHILDREN" => "8",
                                                "PHP_FCGI_MAX_REQUESTS" => "5000" 
                                                        ),
                                   "bin-copy-environment" => (""),
                                   "broken-scriptfilename" => "enable" 
                                 )
                               )
                            )

I know about "rewrite" solution, but I think if lighttpd could interpret all PAGES as being PHP ones, it would be just GREAT.
So, I could have scripts saved without ".php" extension.

Could you point me some direction on how to do this?

By the way... how do you do here on forum???
Look: "http://redmine.lighttpd.net/projects/lighttpd/boards/3"

"boards" is the script an "3" the $_GET parameter ?
or maybe "lighttpd" is the script and "boards" and "3" the params, etc.

This is exactly what I'm looking for!!! ;-)


Replies (1)

RE: Default-type allways PHP - Added by stbuehler over 14 years ago

Redmine is a rails application. See LighttpdOnRails for the basic setup.
The point is to handle the rewrites in the application; so you just rewrite all (non-static) requests to /index.php

Apart from this this is a support question, not a development question (it has nothing to do with lighttpd development)

Using /index for /index.php is wrong.

    (1-1/1)