Invalid command 'Virtual' in httpd.conf
Posted by: pacoperez (---.124.158.98.client.dyn.strong-in23.as13926.net)
Date: February 19, 2015 12:59PM

Hi there, I installed WAMPserver 2.5 and followed the procedure to activate Virtual Hosts but something weird happens. After following the steps I got an orange icon, then the httpd -t gave me this:

C:\wamp\bin\apache\apache2.4.9\bin>httpd -t
AH00526: Syntax error on line 512 of C:/wamp/bin/apache/apache2.4.9/conf/httpd.c
onf:
Invalid command 'Virtual', perhaps misspelled or defined by a module not include
d in the server configuration

Line 512 in httpd.conf file is this:

512 Virtual hosts
513 Include conf/extra/httpd-vhosts.conf

(by the way how do you do that beautiful way to paste lines here with the alternate background colour and line numbers?!)

It means that I already removed the comment marks '#' to make active those statements.

If I put the comments again like this:

512 # Virtual hosts
513 #Include conf/extra/httpd-vhosts.conf

And I restart WAMPserver, then the icon becomes green but it supposes that it shouldn't happen, right?
And with the icon green my project1 doesn't open but this can be for other reasons.... maybe is bad generated, I will check later...

The question now is: what can I do to solve the Invalid command 'Virtual' error in httpd.conf file?

Thanks in advance : )

Apache Version: 2.4.9
PHP Version: 5.5.12
Server Software: Apache/2.4.9 (Win32) PHP/5.5.12
MySQL Version: 5.6.17
Windows 8.1

Options: ReplyQuote
Re: Invalid command 'Virtual' in httpd.conf
Posted by: RiggsFolly (---.as43234.net)
Date: February 19, 2015 01:17PM

Hi paco,

You need to uncomment the Include .... and not the previous line which IS A COMMENT

So do :-

512 # Virtual hosts
513 Include conf/extra/httpd-vhosts.conf

i.e. just uncomment the instruction line and not the actual comment line that helps flag the location in the file to help you find the actual instruction.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Invalid command 'Virtual' in httpd.conf
Posted by: pacoperez (---.124.158.98.client.dyn.strong-in23.as13926.net)
Date: February 19, 2015 01:33PM

Soooo dummy!! : )) Yes, you're right, it's clearly mentioned in the instructions for virtual hosts.

Thanks RiggsFolly. : )

Options: ReplyQuote
Re: Invalid command 'Virtual' in httpd.conf
Posted by: Self (---.socal.res.rr.com)
Date: June 24, 2015 03:26AM

RiggsFolly Wrote:
-------------------------------------------------------
> Hi paco,
>
> You need to uncomment the Include ....
>
and not the previous line which IS A
> COMMENT
>
> So do :-
>
> 512 # Virtual hosts
> 513 Include conf/extra/httpd-vhosts.conf
>
> i.e. just uncomment the instruction line and not
> the actual comment line that helps flag the
> location in the file to help you find the actual
> instruction.

Thanks for this. I am in the process of setting up WAMP and ran into this same issue. I googles part of the error message when I ran this in the terminal:
cd \wamp\bin\apache\apache2.4.9\bin
httpd -t .


during the setup, I removed the comment # from both lines.

putting it back onto the Virtual hosts line fixed the issue and now the server status is green. As soon as i read your solution I was like "A ha..." i read the setup instructions a little too fast I guess.



Edited 2 time(s). Last edit at 06/24/2015 03:29AM by Self.

Options: ReplyQuote


Sorry, only registered users may post in this forum.