How can I have Vhosts with Lighttpd on Windows and keeping PHP through mod_cgi ?
Posted
by
Pixelastic
on Server Fault
See other posts from Server Fault
or by Pixelastic
Published on 2011-03-03T14:42:05Z
Indexed on
2011/03/03
15:26 UTC
Read the original article
Hit count: 206
Hello,
I installed Lighty on Windows 7 and managed to get it correctly serve both static and PHP files (through mod_cgi
).
At first I got the "No input file selected" message displayed when requesting a .php file. So, I updated the doc_root
value in my php.ini
to match the server.document-root
defined in my Lighty config, and PHP stops complaining.
Then I defined a VHost to point all foo.com
requests to a specific dir. It worked well for all static files but when requesting a .php
file, the mod_cgi
was still picking files from the doc_root
defined in php.ini
, not in the directory I defined for server.document-root
in my Vhost.
I know its what's supposed to happen, PHP follows the config defined in php.ini
. And I have to set this value in my php.ini
otherwise no php is processed at all. What I don't understand is how I'm supposed to have virtual hosts with mod_cgi
enabled here ?
I tried adding [HOST=foo.com]
section in the php.ini
without any luck.
I tried mod_fastcgi but could'n get it to work at all, I also tried mod_simple_host but could get it handle php.
I managed to get it working by copying my PHP install to another dir (and changing the doc_root
value) and adding a cgi.assign
pointing to that install in my vhost. But this is a really hackish way, it means having one PHP install for each virtualhost.
Note that I'm working on a development machine running Windows, this is not a production server, I just wanted to emulate the final Server config locally to test some changes.
I googled a lot this problem but all I can find are people installing Lighty on windows with mod_cgi, or installing Lighty on Windows with virtual hosts, but I never found anyone who managed to get both.
© Server Fault or respective owner