# Upgrade to 2.5.6/2.5.7: Cannot declare class Asset, because the name is already in use

**URL:** <https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020>\
**Category:** Questions\
**Tags:** v2\
**Created:** [November 14, 2017, 12:56pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020 "2017-11-14T12:56:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 12:56pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/1 "2017-11-14T12:56:44Z")

</div>

I just upgraded my site to 2.5.7 from 2.5.5, and it results in a blank site, with the browser saying this site is not working. I don’t even get a whoops page.

Anyone else having any trouble?

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [November 14, 2017, 12:59pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/2 "2017-11-14T12:59:43Z")

</div>

Did you check your PHP error log?

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 1:05pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/3 "2017-11-14T13:05:23Z")

</div>

Ok there is this error in the log…

```auto
[Tue Nov 14 12:49:58.997497 2017] [php7:notice] [pid 7292] [client 192.168.10.1:49424] PHP Fatal error: Cannot declare class Asset, because the name is already in use in /home/vagrant/hashandsalt/public/kirby/branches/multilang.php on line 0
[Tue Nov 14 12:49:58.997521 2017] [php7:notice] [pid 7292] [client 192.168.10.1:49424] PHP Stack trace:
[Tue Nov 14 12:49:58.997526 2017] [php7:notice] [pid 7292] [client 192.168.10.1:49424] PHP 1. {main}() /home/vagrant/hashandsalt/public/index.php:0
[Tue Nov 14 12:49:58.997529 2017] [php7:notice] [pid 7292] [client 192.168.10.1:49424] PHP 2. Kirby->launch() /home/vagrant/hashandsalt/public/index.php:16
[Tue Nov 14 12:49:58.997539 2017] [php7:notice] [pid 7292] [client 192.168.10.1:49424] PHP 3. Kirby->site() /home/vagrant/hashandsalt/public/kirby/kirby.php:695

```

Im running it on the Homestead vagrant box. I also emptied the plugins folder, but issue persists.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 1:45pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/4 "2017-11-14T13:45:44Z")

</div>

I found this issue on GitHub: [https://github.com/getkirby/kirby/issues/606](https://github.com/getkirby/kirby/issues/606). Is there anything in your config?

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 1:52pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/5 "2017-11-14T13:52:18Z")

</div>

I do have this:

```auto
c::set('languages', array(
  array(
    'code' => 'en',
    'name' => 'English',
    'default' => true,
    'locale' => 'en_GB',
    'url' => '/',
  )
));

```

Removing it makes the site work, sort of, but obviously all my content is now wrong because they are in the form of `pagename.en.txt.` but at least i am getting a whoops now.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 1:54pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/6 "2017-11-14T13:54:35Z")

</div>

Hm, the language definition shouldn’t be causing this, though, just calling Kirby in the config

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 1:57pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/7 "2017-11-14T13:57:38Z")

</div>

> [@texnixe](#):
>
> just calling Kirby in the config

I am certainly not doing this.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [November 14, 2017, 3:29pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/8 "2017-11-14T15:29:12Z")

</div>

Do you use any plugins?

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 3:32pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/9 "2017-11-14T15:32:27Z")

</div>

Yes, however, I did empty the plugins folder and the issue persisted. I have the following plugins, some of which have config settings:

autofocus  
autoid  
cachebuster  
focus  
headlineaccordion  
images  
[js-component.php](https://gist.github.com/lukaskleinschmidt/22db8fb3c92c60b23310cc187cae4432)  
kirby-html-minifier  
meta-tags  
piwik  
uniform  
xml-sitemap

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [November 14, 2017, 3:34pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/10 "2017-11-14T15:34:32Z")

</div>

Could you please post your full `config.php` (you may remove the license and other private information)?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 3:35pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/11 "2017-11-14T15:35:25Z")

</div>

And if you have more than one config file, then all of them.

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 3:44pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/12 "2017-11-14T15:44:13Z")

</div>

Sure, here you go…i have 3, however the local one is the only one I know has an issue, i have not tried on live or staging.

local config

```auto
c::set('ka.piwik.url', 'XXX');
c::set('ka.piwik.id', 1);
c::set('ka.piwik.tracking', true);
c::set('ka.piwik.trackingIfLoggedIn', true);
c::set('ka.piwik.widget', true);
c::set('ka.piwik.language', 'en');
c::set('ka.piwik.apitoken', 'XXX');

c::set('cachebuster', false);
c::set('livedomain', 'hashandsalt.dev');

c::set('auto.js.filename', '{name}.js');

c::set('fbpageid', 'XXX');

c::set('license', 'XXX');

c::set('languages', array(
  array(
    'code' => 'en',
    'name' => 'English',
    'default' => true,
    'locale' => 'en_GB',
    'url' => '/',
  )
));

c::set('debug',true);
c::set('cache',false);
c::set('panel.install', true);

// SEO Settings
c::set('meta-tags.default', [
    'title' => function($page) {
        return $page->isHomePage()
                ? site()->seotitle()
                : $page->seotitle().' | '.site()->seotitle();
    },
    'meta' => [
        'description' => function($page) {
            return $page->isHomePage()
            ? site()->seometa()
            : $page->seometa();
        },
        'keywords' => function($page) {
            return $page->isHomePage()
            ? site()->seokeywords()
            : $page->seokeywords();
        },
        'robots' => 'index,follow,noodp',
    ],
    'link' => [
        'canonical' => function($page) { return $page->url(); }
    ],
    'og' => [
        'title' => function($page) {
            return $page->isHomePage()
            ? site()->seotitle()
            : $page->seotitle().' | '.site()->seotitle();
        },
        'image' => function($page) {
          return $page->isHomePage()
          ? site()->shareimage()->toFile()->focusCrop(1200,630)->url()
          : $page->shareimage()->toFile()->focusCrop(1200,630)->url();
        },
        'type' => 'website',
        'site_name' => site()->seotitle(),
        'url' => function($page) { return $page->url(); },
        'description' => function($page) {
            return $page->isHomePage()
            ? site()->seometa()
            : $page->seometa();
        },
    ],
    'twitter' => [
        'title' => function($page) {
            return $page->isHomePage()
            ? site()->seotitle()
            : $page->seotitle().' | '.site()->seotitle();
        },
        'card' => 'summary',
        'site' => site()->twitterusername(),
        'creator' => site()->twitterhandle(),
        'image' => function($page) {
          return $page->isHomePage()
          ? site()->shareimage()->toFile()->focusCrop(800,400)->url()
          : $page->shareimage()->toFile()->focusCrop(800,400)->url();
        },
        'url' => function($page) { return $page->url(); },
        'description' => function($page) {
            return $page->isHomePage()
            ? site()->seometa()
            : $page->seometa();
        },
    ]
]);

c::set('meta-tags.templates', [

'workarticle' => [
  'meta' => [
      'robots' => 'index,follow,noodp'
  ],
  'og' => [
      'type' => 'article',
  ],
  'twitter' => [
      'card' => 'summary_large_image',
      'image' => function($page) {
        return $page->shareimage()->toFile()->focusCrop(800,400)->url();
      },
  ]
],

]);

```

live config:

```auto
c::set('livedomain', 'hashandsalt.com');
c::set('auto.js.filename', '{name}.min.js');
c::set('debug',false);
c::set('cache',false);
c::set('ssl',true);
c::set('panel.install', false);
c::set('cachebuster', true);

```

Staging…

```auto
c::set('livedomain', 'dev.hashandsalt.com');
c::set('auto.js.filename', '{name}.js');
c::set('debug',false);
c::set('cache',false);
c::set('ssl',true);
c::set('panel.install', false);
c::set('cachebuster', false);

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 3:48pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/13 "2017-11-14T15:48:35Z")

</div>

> [@jimbobrjames](#):
>
> c::set(‘meta-tags.default’, [  
> ‘title’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seotitle()  
> : $page-\>seotitle().’ | ‘.site()-\>seotitle();  
> },  
> ‘meta’ =\> [  
> ‘description’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seometa()  
> : $page-\>seometa();  
> },  
> ‘keywords’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seokeywords()  
> : $page-\>seokeywords();  
> },  
> ‘robots’ =\> ‘index,follow,noodp’,  
> ],  
> ‘link’ =\> [  
> ‘canonical’ =\> function($page) { return $page-\>url(); }  
> ],  
> ‘og’ =\> [  
> ‘title’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seotitle()  
> : $page-\>seotitle().’ | ‘.site()-\>seotitle();  
> },  
> ‘image’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>shareimage()-\>toFile()-\>focusCrop(1200,630)-\>url()  
> : $page-\>shareimage()-\>toFile()-\>focusCrop(1200,630)-\>url();  
> },  
> ‘type’ =\> ‘website’,  
> ‘site\_name’ =\> site()-\>seotitle(),  
> ‘url’ =\> function($page) { return $page-\>url(); },  
> ‘description’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seometa()  
> : $page-\>seometa();  
> },  
> ],  
> ‘twitter’ =\> [  
> ‘title’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seotitle()  
> : $page-\>seotitle().’ | '.site()-\>seotitle();  
> },  
> ‘card’ =\> ‘summary’,  
> ‘site’ =\> site()-\>twitterusername(),  
> ‘creator’ =\> site()-\>twitterhandle(),  
> ‘image’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>shareimage()-\>toFile()-\>focusCrop(800,400)-\>url()  
> : $page-\>shareimage()-\>toFile()-\>focusCrop(800,400)-\>url();  
> },  
> ‘url’ =\> function($page) { return $page-\>url(); },  
> ‘description’ =\> function($page) {  
> return $page-\>isHomePage()  
> ? site()-\>seometa()  
> : $page-\>seometa();  
> },  
> ]  
> ]);

It’s those setting causing this. When I put that in a langkit, I get the same error.

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 3:57pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/14 "2017-11-14T15:57:36Z")

</div>

> [@texnixe](#):
>
> It’s those setting causing this. When I put that in a langkit, I get the same error.

Confirmed, if i take those out completely, the site works. What you mean by langkit? Is there a syntax error? I followed the docs for the meta tags plugin, and it works fine with 2.5.5.

Is the issue me or the plugin? 🙂

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 4:03pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/15 "2017-11-14T16:03:54Z")

</div>

Seems to be the calls to `site()` causing this issue.

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 4:10pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/16 "2017-11-14T16:10:30Z")

</div>

> [@texnixe](#):
>
> Seems to be the calls to site() causing this issue.

Is there an alternative way to get the same result?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 4:14pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/17 "2017-11-14T16:14:55Z")

</div>

Replace `site()` with `$site`. And always wrap it in a function:

```auto
c::set('meta-tags.default', [
    'title' => function($page) {
        return $page->isHomePage()
                ? $site->seotitle()
                : $page->seotitle().' | '. $site->seotitle();
    },
    'meta' => [
        'description' => function($page) {
            return $page->isHomePage()
            ? $site->seometa()
            : $page->seometa();
        },
        'keywords' => function($page) {
            return $page->isHomePage()
            ? $site->seokeywords()
            : $page->seokeywords();
        },
        'robots' => 'index,follow,noodp',
    ],
    'link' => [
        'canonical' => function($page) { return $page->url(); }
    ],
    'og' => [
        'title' => function($page) {
            return $page->isHomePage()
            ? $site->seotitle()
            : $page->seotitle().' | '. $site->seotitle();
        },
        'image' => function($page) {
          return $page->isHomePage()
          ? $site->shareimage()->toFile()->focusCrop(1200,630)->url()
          : $page->shareimage()->toFile()->focusCrop(1200,630)->url();
        },
        'type' => 'website',
        'site_name' => function($page) {
            return $site->seotitle();
        },
        'url' => function($page) { return $page->url(); },
        'description' => function($page) {
            return $page->isHomePage()
            ? $site->seometa()
            : $page->seometa();
        },
    ],
    'twitter' => [
        'title' => function($page) {
            return $page->isHomePage()
            ? $site->seotitle()
            : $page->seotitle().' | '. $site->seotitle();
        },
        'card' => 'summary',
        'site' => function($page) {
            return $site->twitterusername();
        },
        'creator' => function($page) {
            return $site->twitterhandle();
        },
        'image' => function($page) {
          return $page->isHomePage()
          ? $site->shareimage()->toFile()->focusCrop(800,400)->url()
          : $page->shareimage()->toFile()->focusCrop(800,400)->url();
        },
        'url' => function($page) { return $page->url(); },
        'description' => function($page) {
            return $page->isHomePage()
            ? $site->seometa()
            : $page->seometa();
        },
    ]
]);

```

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 4:16pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/18 "2017-11-14T16:16:43Z")

</div>

> [@texnixe](#):
>
> Replace site() with $site.

That doesnt fly, I tried that when i first set it up months ago, and just tried again. Issue persists.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 14, 2017, 4:17pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/19 "2017-11-14T16:17:29Z")

</div>

What exactly does not work?

---

<div class="post-metadata">

**Author:** ![jimbobrjames](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jimbobrjames/32/5802_2.png) [@jimbobrjames](https://forum.getkirby.com/u/jimbobrjames)\
**Post date:** [November 14, 2017, 4:20pm UTC](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020/20 "2017-11-14T16:20:44Z")

</div>

Swapping `site()` for `$site` I get a whoops… Undefined variable: site.

If i use the code you posted above, I still get a whoops, same error.

[Next page](https://forum.getkirby.com/t/upgrade-to-2-5-6-2-5-7-cannot-declare-class-asset-because-the-name-is-already-in-use/9020.md?page=2)
