Localhost index page showing PHP errors when VirtualHost has multiple Directory sections
Posted by: MrSandyClams (---.hsd1.pa.comcast.net)
Date: August 02, 2023 05:00AM

hello,

I'm on a recent Wampserver 3 with all the redistributables tested, on Windows 10. My Wamp works normally in every known case. I'm trying to define a VirtualHost in my vhosts config, and when I add a second Directory tag, I see PHP errors appear on my localhost page as though my VirtualHost is improperly recognized. I have replaced the Directory tag with other interchangeable directives, for example Location tags, and those ones will cause the PHP errors to disappear.

any idea what is causing this or how I would fix it? I've already tried "Don't check VirtualHost definitions" and it has no effect. Here are screenshots of my index page and also my conf file:

[imgur.com]

[imgur.com]

thank you!

Options: ReplyQuote
Re: Localhost index page showing PHP errors when VirtualHost has multiple Directory sections
Posted by: Otomatic (Moderator)
Date: August 02, 2023 08:51AM

Hi,

Wampserver is primarily designed for novice or beginner users, which is why the syntax of the httpd-vhosts.conf file is checked, and of course, this syntax must remain simple and ordinary.

In this case, you want to change one or more basic VirtualHosts to "professional" and, as the possibilities are virtually unlimited, it's impossible to carry out a check.

In this case, we advise you to put your VirtualHost modifications in a separate file, e.g. httpd-vhosts-sandy.conf, and to add a line at the end of the httpd-vhosts.conf file:
Include httpd-vhosts-sandy.conf
to your file.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Localhost index page showing PHP errors when VirtualHost has multiple Directory sections
Posted by: MrSandyClams (---.hsd1.pa.comcast.net)
Date: August 02, 2023 01:22PM

nice. I didn't consider myself much of an Apache professional, though I admit this is the first time I've tried a lot of these things in my vhosts-conf rather than in an htaccess file. Thank you for the clarification! Guess I'm learning some more Apache today! Cheers.

Options: ReplyQuote


Sorry, only registered users may post in this forum.