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

Brooking, John John.Brooking at sappi.com
Sun Nov 12 16:41:16 CST 2006


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
-- 


This message may contain information which is private, privileged or confidential and is intended solely for the use of the individual or entity named in the message. If you are not the intended recipient of this message, please notify the sender thereof and destroy / delete the message. Neither the sender nor Sappi Limited (including its subsidiaries and associated companies) shall incur any liability resulting directly or indirectly from accessing any of the attached files which may contain a virus or the like.




More information about the thelist mailing list