Apache won't start with spaces in pathname in httpd.conf (even with quotes)

developdaly picture developdaly · Feb 20, 2013 · Viewed 10.1k times · Source

Problem

Apache won't start if there are spaces in the pathname in a virtual host configuration.

The usual solution is to just wrap the pathname in double quotes, but that doesn't fix it.

I WANT to have spaces in my pathname, so changing to dashes or what not isn't really an option.

The VERY same configuration as below without spaces works.

Sample

<VirtualHost *:80>
    DocumentRoot "C:/Users/Patrick/Google Drive/Projects/My Project"
    ServerName local.example.com
    ServerAlias local.example.com
    <Directory "C:/Users/Patrick/Google Drive/Projects/My Project">
    Options Indexes FollowSymLinks ExecCGI Includes
        AllowOverride All
        Order allow,deny
        Allow from all
        <IfModule mod_php5.c>
            php_admin_flag engine on
            # choose the one you want:
            # This is for E_ALL & ~E_STRICT & ~E_DEPRECATED
            # php_admin_value error_reporting 22527
            # This is for E_ERROR
            php_admin_value error_reporting 1
        </IfModule>
    </Directory>
</VirtualHost>

Answer

Erwan Swak picture Erwan Swak · Feb 20, 2013

did you try DocumentRoot "C:/Users/Patrick/Google\ Drive/Projects/My\ Project" ?