Redirecting apache command line output on Windows

So, you want to run

httpd.exe -tS

to syntax check your conf file and view all virtual hosts. You need the virtual hosts info in a file but

httpd.exe -tS >file.txt

doesn’t work.

That’s because apache output goes to STDERR not STDOUT. I have used dos/windows for years and never had cause to know or use this but simply doing.

httpd.exe -tS 2>file.txt

Will work as it sends the STDERR output to the file you specify.

This entry was posted in Windows Apache MySQL PHP. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>