lighttpd forum lighty > lighttp + FastCGI on Windows

Posted by Kuldeep (Guest)
on 01.08.2006 15:37
Hi ,

Is anyone able to succesfully use lighttpd + FastCGI on Windows . I am 
not able to call the fastcgi application on lighttpd server.

If yes then it would be great if he can guide me what and how i have set 
the configuration file.

Thanks,

Kuldeep
Posted by Jose Adriano Baltieri (Guest)
on 01.08.2006 16:33
Kuldeep wrote:
> Hi ,
> 
> Is anyone able to succesfully use lighttpd + FastCGI on Windows . I am 
> not able to call the fastcgi application on lighttpd server.
> 
> If yes then it would be great if he can guide me what and how i have set 
> the configuration file.

I am using but with my own FastCGI server. It is a remote one, called by 
TCP/IP.

If you want PHP, I guess that what what I have done will not work.

But I'm very interested on knowing people who also run it on Windows, 
cause this is my need.

If you want my configuration file, please take it from here :

http://www.DES.online.unimep.br/au/pub/lighthttpd.conf

See ya !
Posted by Kevin Worthington
on 01.08.2006 18:00
FastCGI has some problems on Windows. I use CGI with PHP instead, and it
works fine.

> If you want my configuration file, please take it from here :
> 
> http://www.DES.online.unimep.br/au/pub/lighthttpd.conf

That URL is wrong. It should be:
http://www.des.online.unimep.br/au/pub/lighttpd.conf
Posted by Kuldeep Bhatnagar (Guest)
on 02.08.2006 15:07
Jose Adriano Baltieri wrote:
> Kuldeep wrote:
>> Hi ,
>> 
>> Is anyone able to succesfully use lighttpd + FastCGI on Windows . I am 
>> not able to call the fastcgi application on lighttpd server.
>> 
>> If yes then it would be great if he can guide me what and how i have set 
>> the configuration file.
> 
> I am using but with my own FastCGI server. It is a remote one, called by 
> TCP/IP.
> 
> If you want PHP, I guess that what what I have done will not work.
> 
> But I'm very interested on knowing people who also run it on Windows, 
> cause this is my need.
> 
> If you want my configuration file, please take it from here :
> 
> http://www.DES.online.unimep.br/au/pub/lighthttpd.conf
> 
> See ya !


Hi,

I am very much new to this technology. Can you please briefly guide me 
how to write my own fastcgi server in c or c++. Is it specific to web 
server or it is generic. Is fastcgi server different from from a Fastcgi 
application and in what sense it is different.

Thanks,

Kuldeep
Posted by Jose Adriano Baltieri (Guest)
on 03.08.2006 15:29
Kuldeep Bhatnagar wrote:
> Jose Adriano Baltieri wrote:
>> Kuldeep wrote:
>>> Hi ,
>>> 
>>> Is anyone able to succesfully use lighttpd + FastCGI on Windows . I am 
>>> not able to call the fastcgi application on lighttpd server.
>>> 
>>> If yes then it would be great if he can guide me what and how i have set 
>>> the configuration file.
>> 
>> I am using but with my own FastCGI server. It is a remote one, called by 
>> TCP/IP.
>> 
>> If you want PHP, I guess that what what I have done will not work.
>> 
>> But I'm very interested on knowing people who also run it on Windows, 
>> cause this is my need.
>> 
>> If you want my configuration file, please take it from here :
>> 
>> http://www.DES.online.unimep.br/au/pub/lighthttpd.conf
>> 
>> See ya !
> 
> 
> Hi,
> 
> I am very much new to this technology. Can you please briefly guide me 
> how to write my own fastcgi server in c or c++. Is it specific to web 
> server or it is generic. Is fastcgi server different from from a Fastcgi 
> application and in what sense it is different.
> 
> Thanks,
> 
> Kuldeep

I posted a reply to another topic.

Let me know : will you run Lighty on Windows ?

Which is your demand, I mean, how many requests (hits/pages) do you 
expect to process per day ?

Will you use SSL (httpS) or not ?

How do you generate your html pages ? I mean, do you have some sort of 
scripting language of your own ? What language is it ? How is the 
generation process ?

Where are you talking from ?

Thanks !
Posted by Charles (Guest)
on 13.08.2006 01:44
Kuldeep wrote:
> Is anyone able to succesfully use lighttpd + FastCGI on Windows

Nope, FastCGI is known not to work on Windows. You still can install 
Lighty easily on Windows: 
http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
Posted by Stan Papusa (Guest)
on 13.08.2006 05:28
Charles wrote:
> Kuldeep wrote:
>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
> 
> Nope, FastCGI is known not to work on Windows. You still can install 
> Lighty easily on Windows: 
> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP

Sorry, but lighttpd + FastCGI works in windows. I use with success this 
combination.

lighttpd.conf
.................................................
server.modules  = ("mod_rewrite","mod_alias","mod_access", 
"mod_cgi",                                "mod_accesslog" )
server.document-root        = "C:/lighttpd/htdocs/"
alias.url = ( "/admin/" => "C:/lighttpd/administrare/" )
...............
cgi.assign = ( ".php" => "c:/lighttpd/php/php-cgi.exe" )
...............................................
Posted by Charles (Guest)
on 13.08.2006 07:11
Stan Papusa wrote:
> Sorry, but lighttpd + FastCGI works in windows. I use with success this 
> combination.

Could you give us a details procedure to achieve it?
I'll post it on the wiki if it works fine.
Posted by Kevin Worthington
on 17.08.2006 00:03
> Sorry, but lighttpd + FastCGI works in windows. I use with success this 
> combination.
> 
> lighttpd.conf
> .................................................
> server.modules  = ("mod_rewrite","mod_alias","mod_access", 
> "mod_cgi",                                "mod_accesslog" )
> server.document-root        = "C:/lighttpd/htdocs/"
> alias.url = ( "/admin/" => "C:/lighttpd/administrare/" )
> ...............
> cgi.assign = ( ".php" => "c:/lighttpd/php/php-cgi.exe" )
> ...............................................

NO. You are using _CGI_ not _Fast_CGI... FastCGI with PHP and MySQL on
Windows has its share of problems...
Posted by Wladimir Tavares
on 12.09.2007 01:56
Charles wrote:
> Kuldeep wrote:
>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
> 
> Nope, FastCGI is known not to work on Windows. You still can install 
> Lighty easily on Windows: 
> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP

Hi!

I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
Both are running as windows services. I am using lighttpd from WLMP.
I am testing it. Soon I will prepare an html file describing it.
Posted by Roland M. (Guest)
on 14.09.2007 18:39
> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
> Both are running as windows services. I am using lighttpd from WLMP.
> I am testing it. Soon I will prepare an html file describing it.

I await these instructions anxiously!  I'm using PHP 5.2.4 (stock, chose 
"Other CGI" at install time to get php-cgi.exe) and LightTPD/1.4.18-1 
(Win32) from WLMP.

I'm using fastCGI and starting php-cgi.exe -b 521 before I run the 
webserver.
I've tried "broken_scriptfilename" and setting doc_root in php.ini but 
have had no luck.  I always get:

  No input file specified.

Looking forward to your guide.
on 01.11.2007 23:49
I too am eager for this info.  *bump*

Wladimir Tavares wrote:
> Charles wrote:
>> Kuldeep wrote:
>>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
>> 
>> Nope, FastCGI is known not to work on Windows. You still can install 
>> Lighty easily on Windows: 
>> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
> 
> Hi!
> 
> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
> Both are running as windows services. I am using lighttpd from WLMP.
> I am testing it. Soon I will prepare an html file describing it.
Posted by Wladimir Tavares (Guest)
on 02.11.2007 08:14
New house Computer services wrote:
> I too am eager for this info.  *bump*
> 
> Wladimir Tavares wrote:
>> Charles wrote:
>>> Kuldeep wrote:
>>>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
>>> 
>>> Nope, FastCGI is known not to work on Windows. You still can install 
>>> Lighty easily on Windows: 
>>> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
>> 
>> Hi!
>> 
>> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
>> Both are running as windows services. I am using lighttpd from WLMP.
>> I am testing it. Soon I will prepare an html file describing it.

Hi! I'm so sorry! I had a lot of things to do ans I had to move to 
amother house and I was without Internet conection for 1 month. I 
promise I'll post later today.
Posted by Wladimir Tavares
on 02.11.2007 16:50
Attachment: files.zip
Wladimir Tavares wrote:
> New house Computer services wrote:
>> I too am eager for this info.  *bump*
>> 
>> Wladimir Tavares wrote:
>>> Charles wrote:
>>>> Kuldeep wrote:
>>>>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
>>>> 
>>>> Nope, FastCGI is known not to work on Windows. You still can install 
>>>> Lighty easily on Windows: 
>>>> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
>>> 
>>> Hi!
>>> 
>>> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
>>> Both are running as windows services. I am using lighttpd from WLMP.
>>> I am testing it. Soon I will prepare an html file describing it.
> 
> Hi! I'm so sorry! I had a lot of things to do ans I had to move to 
> amother house and I was without Internet conection for 1 month. I 
> promise I'll post later today.

Finally I have time to reply!

Check the attached zip file for instructions.

If you don’t feel safe using the included .exe files, you can download 
them from the WLMP Project webpage or from one of their mirrors 
http://www.airplanet.hu/dtech/wlmp-mirror/

Things are running smoothly for me. I used the test_php.php script and 
with Process Explorer - 
http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx 
you can see that the PHP FastCGI daemon is accepting connections.



on 07.11.2007 09:45
awesome!  thank you!  I will check this out soon(ish).


> Finally I have time to reply!
> 
> Check the attached zip file for instructions.
> 
> If you don’t feel safe using the included .exe files, you can download 
> them from the WLMP Project webpage or from one of their mirrors 
> http://www.airplanet.hu/dtech/wlmp-mirror/
> 
> Things are running smoothly for me. I used the test_php.php script and 
> with Process Explorer - 
> http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx 
> you can see that the PHP FastCGI daemon is accepting connections.
Posted by Guest (Guest)
on 12.12.2007 08:39
Roland M. wrote:
>> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
>> Both are running as windows services. I am using lighttpd from WLMP.
>> I am testing it. Soon I will prepare an html file describing it.
> 
> I await these instructions anxiously!  I'm using PHP 5.2.4 (stock, chose 
> "Other CGI" at install time to get php-cgi.exe) and LightTPD/1.4.18-1 
> (Win32) from WLMP.
> 
> I'm using fastCGI and starting php-cgi.exe -b 521 before I run the 
> webserver.
> I've tried "broken_scriptfilename" and setting doc_root in php.ini but 
> have had no luck.  I always get:
> 
>   No input file specified.
> 
> Looking forward to your guide.

I too am getting "No input file specified" after a successful first 
request...
Posted by Guest (Guest)
on 29.12.2007 16:52
PLEASE HELP!
I can't find any kind of readme or anything that tells me how to get 
FastCGI/PHP to work on Windows! I downloaded the file from your link but 
I can't find anything in it that tells me how to do this!




Wladimir Tavares wrote:
> Wladimir Tavares wrote:
>> New house Computer services wrote:
>>> I too am eager for this info.  *bump*
>>> 
>>> Wladimir Tavares wrote:
>>>> Charles wrote:
>>>>> Kuldeep wrote:
>>>>>> Is anyone able to succesfully use lighttpd + FastCGI on Windows
>>>>> 
>>>>> Nope, FastCGI is known not to work on Windows. You still can install 
>>>>> Lighty easily on Windows: 
>>>>> http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
>>>> 
>>>> Hi!
>>>> 
>>>> I have managed to run successfully lighttpd + PHP on FastCGI on Windows. 
>>>> Both are running as windows services. I am using lighttpd from WLMP.
>>>> I am testing it. Soon I will prepare an html file describing it.
>> 
>> Hi! I'm so sorry! I had a lot of things to do ans I had to move to 
>> amother house and I was without Internet conection for 1 month. I 
>> promise I'll post later today.
> 
> Finally I have time to reply!
> 
> Check the attached zip file for instructions.
> 
> If you don’t feel safe using the included .exe files, you can download 
> them from the WLMP Project webpage or from one of their mirrors 
> http://www.airplanet.hu/dtech/wlmp-mirror/
> 
> Things are running smoothly for me. I used the test_php.php script and 
> with Process Explorer - 
> http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx 
> you can see that the PHP FastCGI daemon is accepting connections.
Posted by New House Computer Services (Guest)
on 04.01.2008 08:51
I got it to work!  it wasn't easy.  I had to tweak my lighttpd conf file 
and my php.ini file a few times.

relevant bits for the conf are here:

<code>static-file.exclude-extensions = ( ".php", ".pl", ".cgi" )

fastcgi.server = ( ".php" =>( "localhost" =>("host" => 
"127.0.0.1","port" => 521 )))</code>

and you have to remove the php assignment from this:

<code>cgi.assign                  = (
                                ".pl"  => "Perl/perl.exe",
                                ".cgi" => "Perl/perl.exe" )</code>

and uncomment fastcgi from the mods list.

and in various parts of php.ini:

<code>
doc_root =

cgi.force_redirect = 1

cgi.fix_pathinfo = 1

extension=php_sockets.dll
</code>

I also had to modify the batch installer because my default Windows 
lighty folders are all in c:\program files\lighttpd.

NB:  you probably want to create a user and assign it appropriate 
permissions for what lighty and php should be able to see.  then you can 
run the lighty and php services under that user.

I installed this on one test server running windows XP and one active 
server running win2k.  both have seemed very healthy and happy, so I 
installed it on a third server running XP.  I've had two problems with 
that server, and I can't figure out what it is.  I imagine it might have 
something to do with security and active directory stuff, which I'm 
undereducated in.

my problem is that I don't see any logging from the lighttpd service or 
the php service to tell me why they won't work.

(a) the lighttpd service, using the very same command line parameters 
that the administrator user can enter from a command shell and it works 
fine, says it is running in Services, but does not respond to web hits. 
I have tried this under System and when running the service as the local 
admin user -- the same user that I am when it works from the command 
line.  I don't see any logging that explains why what appears to be a 
running service is not responding.  I have solved it temporarily by 
starting LightTPD from a batch file which I leave open and minimized, 
but that's no good.

(b) the PHP service runs great and works quickly, but then dies after 
only a few hours of running.  again, the Services list shows it as 
running, but it is totally unresponsive.  and again, I don't see the PHP 
service logging why it is crashing anywhere.

any help?

thanks!


> Finally I have time to reply!
> 
> Check the attached zip file for instructions.
> 
> If you don’t feel safe using the included .exe files, you can download 
> them from the WLMP Project webpage or from one of their mirrors 
> http://www.airplanet.hu/dtech/wlmp-mirror/
> 
> Things are running smoothly for me. I used the test_php.php script and 
> with Process Explorer - 
> http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx 
> you can see that the PHP FastCGI daemon is accepting connections.
Posted by Guest (Guest)
on 13.01.2008 09:28
Wladimir Tavares wrote:
> 
> Finally I have time to reply!
> 
> Check the attached zip file for instructions.
> 
> If you don’t feel safe using the included .exe files, you can download 
> them from the WLMP Project webpage or from one of their mirrors 
> http://www.airplanet.hu/dtech/wlmp-mirror/
> 
> Things are running smoothly for me. I used the test_php.php script and 
> with Process Explorer - 
> http://www.microsoft.com/technet/sysinternals/utilities/processexplorer.mspx 
> you can see that the PHP FastCGI daemon is accepting connections.

You said you got it "working". I tried several days but i couldn't 
prevent the fastcgi service from crashing randomly. All i have found was 
"fastcgi-php and lighty don't work together on windows. give up!". I 
can't find any significant differences in our config files.

So my question is does your fastcgi process crash randomly(srvany keeps 
running)?
Posted by Markus Birth (Guest)
on 29.01.2008 11:06
Guest wrote:
> So my question is does your fastcgi process crash randomly(srvany keeps 
> running)?

Yap, same problem here on a Win2k3 VMware. Eventlog shows something with 
php5ts!zend_mm_shutdown. php-cgi.exe was randomly crashing under load so 
we are back to normal CGI mode for now.
Posted by Markus Birth (Guest)
on 08.02.2008 09:46
Did anyone already try Lighty 1.5.x with mod_proxy_backend_fastcgi on 
Windows?

I can't get it to do anything. When using the following config 
(fastcgi.server seems deprecated):

$PHYSICAL["existing-path"] =~ "\.php$" {
    proxy-core.balancer = "round-robin"
    proxy-core.protocol = "fastcgi"
    proxy-core.allow-x-sendfile = "enable"
    proxy-core.backends = ( "127.0.0.1:521" )
    proxy-core.max-pool-size = 1
    proxy-core.rewrite-request = (
        "_pathinfo" => ( "\.php(/.*)" => "$1" ),
    )
}

Nothing happens when loading a .php file. The php-cgi.exe process stays 
completely idle.

Also Spawn-FCGI.exe seems not to work.

Anyone figured this out already?
Posted by Guest (Guest)
on 14.02.2008 00:14
IT STILL WON'T FUCKING WORK AT ALL! IT STARTS AND THEN DIES AFTER LIKE 
HALF A SECOND SOMEBODY HELP!!!
Posted by Stark Stark
on 16.02.2008 17:18
There is a pack named lighty2go which is capable ..

I m not into all this stuffs. but when i tried lighttpd individual
installation with other components like PHP+MYSQL+ACTIVEPERL+PMA it
seems that i cannot work with fastcgi..

But if according to   Wladimir Tavares as he commented above that he is
capable of running fastcgi with that file he provided.

so in order to see that i tried it in my individual installation's of
lighttpd+php+mysql+activeperl+pma but when ever i tried to open the file
test_php.php it shows nothing just http_404.htm error page..

so i tried the same file but this time with the package provided by
lighty2go the same file worked ... (lighty2go =
lighttpd+php+miniperl+mysql+pma)

so the thing is i wanted to know that the file provided by    Wladimir
Tavares ( test_php.php) can this file be executed only by cgi?.. or it
can only run with the fastcgi function..?

if it uses only fastcgi then lighty2go can do it.. but i also want to
know the method behins this.. so i can do the same thing for my
individual installation of lighttpd+PHP+MYSQL+ACTIVEPERL+PMA.

any help would really be appreciable.

Sorry for my bad  English.
Posted by John Anders (Guest)
on 17.02.2008 09:20
WLMP's FastCGI server soluiton for php, it's works for me.

lighttpd-inc.conf:
...
server.modules              = ( ...
                                "mod_fastcgi",
                                ...
                              )
...
fastcgi.server              = ( ".php" =>
                                ( "localhost" =>
                                  (
                                    "host" => "127.0.0.1",
                                    "port" => 1879
                                  )
                                )
                              )
...

Batch script:
http://ftp.dtech.hu/pub/Other/PHP-FastCGI/phprun.bat

Screenshot:
http://ftp.dtech.hu/pub/Other/PHP-FastCGI/fastcgi-server.png
Posted by thiskitchen (Guest)
on 24.06.2008 12:40
right white land tree australia we trust yahoo
Posted by h (Guest)
on 19.07.2008 18:26
I have the stock PHP (php.net) running over FastCGI with the standalone 
distribution of LightTPD from WLMP (wlmp-project.net). The settings are 
essentially the same as in John Anders's post, but I got

"No input file specified"

until I explicitly set docroot.

So, in lighty's conf:

...
server.modules     = ( ...
                       "mod_fastcgi",
                       ...
                     )
...
fastcgi.server     = ( ".php" =>
                       ( "localhost" =>
                         (
                           "host" => "127.0.0.1",
                           "port" => 1879,
                           "docroot" => "c:/Program 
Files/LightTPD/htdocs/"
                         )
                       )
                     )
...

And the php fastcgi server is started with:

CD "c:\Program Files\PHP\"
php-cgi.exe -b 127.0.0.1:1879

Obviously your paths may vary, and you don't have to use port 1879.
Hope this helps someone with the same problem.