<p><code>siteUrl</code> works with an array of locales if you're using the actual <a href="http://buildwithcraft.com/docs/config-settings#siteUrl" rel="nofollow">siteUrl config setting</a>.  What you're currently doing is creating a separate 'siteUrl' environment variable, which places in the control panel aren't expecting to be in array format.</p>

<p>More good info on the different ways to set <code>siteUrl</code> <a href="https://craftcms.stackexchange.com/questions/920/what-s-the-recommended-way-to-set-the-site-url">here</a>.</p>

CC BY-SA 3.0
2015-02-24T18:10:44.410Z
2015-02-24T18:10:44.410Z
Brad Bell
<p>So Brad, this:</p>

<pre><code>'pazzo.dev' =&gt; array(
    'devMode' =&gt; true,
    'environmentVariables' =&gt; array(
        'fileSystemPath' =&gt; '/Applications/MAMP/htdocs/pazzo/',
    ),
    'siteUrl' =&gt; array(
                 'en' =&gt; 'http://pazzo.dev:8888/en/',
                 'fr' =&gt; 'http://pazzo.dev:8888/fr/',
                 'nl' =&gt; 'http://pazzo.dev:8888/'
             )
),
</code></pre>

<p>is more like it then? (seems to work fine)</p>

CC BY-SA 3.0
2015-02-24T20:02:27.690Z
This is how to do it, Erwin. Things were more complicate before Craft 2.0 though!
carlcs
CC BY-SA 3.0
2015-02-24T19:34:52.993Z
2015-02-24T19:34:52.993Z
erwinheiser
<p>Has something changed recently regarding the ocalized {siteUrl} setting? I'm setting up a new localized site on MAMP PRO and the old config code I used on several other projects is throwing an error "Array to string conversion".</p>

<p>This works fine:</p>

<pre><code>return array(
'*' =&gt; array(
    'omitScriptNameInUrls' =&gt; true,
),

'pazzo.dev' =&gt; array(
    'devMode' =&gt; true,
    'environmentVariables' =&gt; array(
        'fileSystemPath' =&gt; '/Applications/MAMP/htdocs/pazzo/',
        'siteUrl' =&gt; 'http://pazzo.dev:8888/'
    )
),

'*.pazzo.be' =&gt; array(
    'devMode' =&gt; false,
    'cooldownDuration' =&gt; 0,
    'environmentVariables' =&gt; array(
        'fileSystemPath' =&gt; '/opt/www/pocopazzobvba/web/www.pazzo.be/',
        'siteUrl' =&gt; 'http://www.pazzo.be/'
    )
)
</code></pre>

<p>);</p>

<p>This (what I have used before) throws the error.</p>

<pre><code>return array(
'*' =&gt; array(
    'omitScriptNameInUrls' =&gt; true
),
'pazzo.dev:8888' =&gt; array(
    'devMode' =&gt; true,
    'environmentVariables' =&gt; array(
        'siteUrl' =&gt; array(
            'en' =&gt; 'http://pazzo.dev:8888/en/',
            'fr' =&gt; 'http://pazzo.dev:8888/fr/',
            'nl' =&gt; 'http://pazzo.dev:8888/'
        ),
        'fileSystemPath' =&gt; '/Applications/MAMP/htdocs/pazzo/'
    )
),
'www.pazzo.be' =&gt; array(
    'cooldownDuration' =&gt; 0,
    'devMode' =&gt; false,
    'environmentVariables' =&gt; array(
        'siteUrl' =&gt; array(
            'en' =&gt; 'http://www.pazzo.be/en/',
            'fr' =&gt; 'http://www.pazzo.be/fr/',
            'nl' =&gt; 'http://www.pazzo.be/'
        ),
        'fileSystemPath' =&gt; '/opt/www/pocopazzobvba/web/www.pazzo.be/'
    )
)
</code></pre>

<p>);</p>

<p>Am I missing something obvious??</p>

<localization><error-message><mamp>
Localized {siteUrl} setting - confused
# Localized {siteUrl} setting - confused

(Asked by: username_0 on 2015-02-24)

Has something changed recently regarding the ocalized {siteUrl} setting? I'm setting up a new localized site on MAMP PRO and the old config code I used on several other projects is throwing an error "Array to string conversion".
This works fine:
return array(
'*' => array(
    'omitScriptNameInUrls' => true,
),

'pazzo.dev' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/',
        'siteUrl' => 'http://pazzo.dev:8888/'
    )
),

'*.pazzo.be' => array(
    'devMode' => false,
    'cooldownDuration' => 0,
    'environmentVariables' => array(
        'fileSystemPath' => '/opt/www/pocopazzobvba/web/www.pazzo.be/',
        'siteUrl' => 'http://www.pazzo.be/'
    )
)

);
This (what I have used before) throws the error.
return array(
'*' => array(
    'omitScriptNameInUrls' => true
),
'pazzo.dev:8888' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'siteUrl' => array(
            'en' => 'http://pazzo.dev:8888/en/',
            'fr' => 'http://pazzo.dev:8888/fr/',
            'nl' => 'http://pazzo.dev:8888/'
        ),
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/'
    )
),
'www.pazzo.be' => array(
    'cooldownDuration' => 0,
    'devMode' => false,
    'environmentVariables' => array(
        'siteUrl' => array(
            'en' => 'http://www.pazzo.be/en/',
            'fr' => 'http://www.pazzo.be/fr/',
            'nl' => 'http://www.pazzo.be/'
        ),
        'fileSystemPath' => '/opt/www/pocopazzobvba/web/www.pazzo.be/'
    )
)

);
Am I missing something obvious??

**Tags:** localization, error-message, mamp

---

## 2 answers

### Answer by username_1 on 2015-02-24. Score: 2

`siteUrl` works with an array of locales if you're using the actual [siteUrl config setting](http://buildwithcraft.com/docs/config-settings#siteUrl). What you're currently doing is creating a separate 'siteUrl' environment variable, which places in the control panel aren't expecting to be in array format.

More good info on the different ways to set `siteUrl` [here](https://craftcms.stackexchange.com/questions/920/what-s-the-recommended-way-to-set-the-site-url).


---

### Answer by username_0 on 2015-02-24. Score: 1

So Brad, this:
'pazzo.dev' => array(
    'devMode' => true,
    'environmentVariables' => array(
        'fileSystemPath' => '/Applications/MAMP/htdocs/pazzo/',
    ),
    'siteUrl' => array(
                 'en' => 'http://pazzo.dev:8888/en/',
                 'fr' => 'http://pazzo.dev:8888/fr/',
                 'nl' => 'http://pazzo.dev:8888/'
             )
),

is more like it then? (seems to work fine)

> **Comments:**
> **username_2**: This is how to do it, Erwin. Things were more complicate before Craft 2.0 though!  

---

