Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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>
like image 906
developdaly Avatar asked Feb 20 '13 21:02

developdaly


1 Answers

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

like image 158
Erwan Swak Avatar answered Oct 20 '22 14:10

Erwan Swak