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

11,073

Solution 1

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

Solution 2

I got it working by using DOS 8.3 paths:

c:/users/patric~1/google~1/projec~1/myproj~1

You can see the DOS path by using dir /x on the command line.

Share:
11,073
developdaly
Author by

developdaly

Clean web design. Cleaner code. WordPress enthusiast. developdaly.com

Updated on June 16, 2022

Comments

  • developdaly
    developdaly almost 2 years

    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>
    
  • developdaly
    developdaly about 11 years
    That did the trick! I'll accept in 10 minutes when it lets me.
  • developdaly
    developdaly about 11 years
    Well, I spoke too soon. Apache DOES start, but then I get a 403 when trying to pull the site up in the browser.
  • Wesley Smith
    Wesley Smith about 8 years
    What does this even mean?