1

I have followed the points set out in the Craft Docs relating to environmentVariables, making sure to include '*' => array() before other config arrays. Here is my craft/config/general.php:

return array(

    '*' => array(
        'omitScriptNameInUrls' => true,
        'defaultImageQuality' => 49,
    ),

    'dev.sitename' => array(
        'siteUrl' => 'http://dev.sitename/',
        'environmentVariables' => array(
            'basePath' => '/Users/adammenczykowski/Sites/Sitename/sitename/public/',
            'baseUrl' => 'http://dev.sitename/',
        )
    ),

    'sitename' => array(
        'devMode' => false,
        'siteUrl' => 'http://sitename.youi.design/',
        'environmentVariables' => array(
            'basePath' => '/home/forge/sitename/public/',
            'baseUrl'  => 'http://sitename/',
        )
    )

);

Asset sources reference the basePath when configuring the File System Path like so:

{basePath}images/

Yes, the folder exists. I have been using pwd and copying the result into the respective general.php setting.

However, when I try to update asset indexes, I get the popup:

The path of your source "SVG" appears to be invalid.`

Any tips? Thanks in advance.

Running Craft CMS 2.6.2797

0
2

2 factors were at play here:

  • The HTML-Cache plugin was clouding my development analysis by not showing me updated templated entries.

  • I had set the local path wrong, it should have respected my Vagrant VM file structure, /home/vagrant/Sites/Sitename/sitename/public

Disabling the html cache plugin and repairing the basePath environment variable did the trick.

1
  • 1
    Good stuff, Adam. We all get trapped by such things and do -- on the first time.... Caches can really muddy waters also, similar truth. Glad you posted, for others to find. Jul 27 '16 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.