[thelist] Configuring Apache 2, PHP5, and virtual hosts

David Heggie david at reefnet.co.uk
Tue Nov 14 10:01:35 CST 2006


Hi John

I seem to remember that there's a problem with the php5apache2.dll 
included in the windows installer. I'd recommend downloading a newer 
version from http://www.apachelounge.com/download/ and trying that, 
rather than as a cgi.

I've got php 5.1.6 running fine with virtual hosts on windows xp.

David

Brooking, John wrote:
> Help! I'm a coder, not an admin, and I'm tearing my hair out trying to
> configure my local Apache 2.2 (Windows) server to run PHP5 with virtual
> hosts! I've looked at a lot of documentation and tutorials, but not much
> seems to address the PHP and virtual host combination.
> 
> Maybe complicating matters, I seem to be running PHP as a CGI, because
> those were the instructions that I was able to get to work before I
> started trying to add in virtual hosts. I was not able to get it working
> as a module using php5apache2.dll. That file is present, but for some
> reason the LoadModule statement for it was preventing Apache from
> starting, and I never did figure out why. I don't know if this is part
> of my primary problem or not.
> 
> Anyway, as a CGI, I was finally able to get PHP working under the
> default document root, and part of that involved setting PHP's doc_root
> to match Apache's DocumentRoot. But when I added a virtual host, PHP
> would not work in that site, still only in the default site. So I gave
> up on that for the moment and tried switching Apache's default document
> root to the new area, and it still would not work. I finally realized
> (after spending 1/2 hour composing my first message to this list, which
> I never sent) that if I *also* changed PHP's doc_root to match up with
> Apache's new DocumentRoot, it works!
> 
> But, if I have virtual hosts, I can't also have multiple settings for
> doc_root in php.ini, can I? How is that supposed to work in a virtual
> host environment? This is the information I can't seem to find. Or maybe
> after several hours just getting this far, I'm tired of searching and
> thinking, and just need to ask if anyone here has the answer. :-|
> 
> Any advice is appreciated, thanks in advance.
> 
> - John

-- 
ReefNet
a: 17 Francis Street, Stornoway, Isle of Lewis, HS1 2NB
t: 01851 700 080
e: david at reefnet.co.uk
w: http://www.reefnet.co.uk
skype: reefnet_david
msn: david at reefnet.co.uk



More information about the thelist mailing list