I have Apache24. PHP 8.4.15, and MySQL 9.5.0 on Windows.
Running phpinfo(); in index.php located in C:\Apache24\htdocs works when "localhost" is entered in the address bar of a browser. I currently have 3 dev sites in remote folders. I believe what I need to do is create Aliases inside httpd.conf to point to the three sites.
The few Windows examples I found gave different solutions which either seemed to do nothing (Apache restarted but opening my remote index.html file opened in file:///C:/John's%20Stuff/Hobbies/Developing/Web%20Development/GCHS/index.html. One conf modification, upon restart, Apache threw the errors:
AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host.example.com] does not exist
AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host2.example.com] does not exist
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/Apache24/conf/httpd.conf:532
AH00112: Warning: DocumentRoot [C:/John's Stuff/Hobbies/Developing/Web/GCHS] does not exist
AH00112: Warning: DocumentRoot [C:/Apache/htdocs] does not exist
With these mods, the config file was modified:
ServerName localhost <Directory /> AllowOverride none Require all denied </Directory> Include conf/extra/httpd-vhosts.conf <Directory "C:/John's Stuff/Hobbies/Developing/Web Development "> Order Deny,Allow Allow from all </Directory> NameVirtualHost 127.0.0.1 <VirtualHost 127.0.0.1> DocumentRoot "C:/John's Stuff/Hobbies/Developing/Web/GCHS" ServerName imheuristic.local </VirtualHost> <VirtualHost 127.0.0.1> DocumentRoot C:/Apache/htdocs ServerName localhost </VirtualHost> I obviously don't know what I am doing. Can someone set me straight?
Thank you for the reply, Luuk:
C:\Apache24\bin>httpd.exe -t -D DUMP_VHOSTS AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host2.example.com] does not exist AH00548: NameVirtualHost has no effect and will be removed in the next release C:/Apache24/conf/httpd.conf:532 AH00112: Warning: DocumentRoot [C:/John's Stuff/Hobbies/Developing/Web/GCHS] does not exist AH00112: Warning: DocumentRoot [C:/Apache/htdocs] does not exist VirtualHost configuration: 127.0.0.1:* is a NameVirtualHost default server imheuristic.local (C:/Apache24/conf/httpd.conf:533) port * namevhost imheuristic.local (C:/Apache24/conf/httpd.conf:533) port * namevhost localhost (C:/Apache24/conf/httpd.conf:538) *:80 is a NameVirtualHost default server dummy-host.example.com (C:/Apache24/conf/extra/httpd-vhosts.conf:23) port 80 namevhost dummy-host.example.com (C:/Apache24/conf/extra/httpd-vhosts.conf:23) alias www.dummy-host.example.com port 80 namevhost dummy-host2.example.com (C:/Apache24/conf/extra/httpd-vhosts.conf:32) And
C:\Apache24\bin>httpd -t AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [C:/Apache24-64/docs/dummy-host2.example.com] does not exist AH00548: NameVirtualHost has no effect and will be removed in the next release C:/Apache24/conf/httpd.conf:532 AH00112: Warning: DocumentRoot [C:/John's Stuff/Hobbies/Developing/Web/GCHS] does not exist AH00112: Warning: DocumentRoot [C:/Apache/htdocs] does not exist Syntax OK
httpd.exe -t -D DUMP_VHOSTS(use edit to add it to your question) (more info: Is there a command to display apache vhost config?)httpd -t, which produces a syntax check for config files (see:httpd -?)<Directory "C:/John's Stuff/Hobbies/Developing/Web Development ">(the name should be between the double quotes, and it ends with a space)