# PHP Fatal error: Cannot redeclare dump()

**URL:** <https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774>\
**Category:** Questions\
**Tags:** v2\
**Created:** [February 21, 2018, 1:40pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774 "2018-02-21T13:40:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [February 21, 2018, 1:40pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/1 "2018-02-21T13:40:50Z")

</div>

Was going to install a plugin with `kirby plugin:install author/name` and got the following error

```auto
PHP Fatal error: Cannot redeclare dump() (previously declared in /Users/xx/.composer/vendor/symfony/var-dumper/Resources/functions/dump.php:18) in /Users/xx/website/kirby/vendor/getkirby/toolkit/helpers.php on line 114

```

The only thing that could have messed things up is that I installed valet with composer some days ago, but I am not using it for this website.

If I do `kirby update` I get the same error as well.

Ideas?

---

<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:** [February 21, 2018, 1:43pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/2 "2018-02-21T13:43:19Z")

</div>

Have you recently installed anything? Like Laravel Valet maybe?

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [February 21, 2018, 1:54pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/3 "2018-02-21T13:54:18Z")

</div>

Yes, I said that (maybe should have been more explicit).

---

<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:** [February 21, 2018, 1:57pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/4 "2018-02-21T13:57:24Z")

</div>

Sorry, I overlooked that. I’m actually getting the same error since having installed Valet. Haven’t had a chance to look into this.

The functions conflict because they are not namespaced or prefixed, and since they all live in the same bucket, well, they collide.

> <https://github.com/laravel/valet/issues/292>

> **[consolidation/cgr](https://github.com/consolidation/cgr)**
>
> cgr - Safe replacement for \`composer global require\`

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [February 21, 2018, 2:15pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/5 "2018-02-21T14:15:26Z")

</div>

I think I’m gonna take it off for now… Thanks for pointing it out!

For anyone needing this — [https://stackoverflow.com/a/40279538](https://stackoverflow.com/a/40279538)

(I replaced `brew uninstall php70` w/ `brew uninstall php72`)

---

<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:** [February 21, 2018, 2:38pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/6 "2018-02-21T14:38:07Z")

</div>

Does it still happen if you stop Valet running temporarily? Does it really need complete removal?

You can stop its daemon from running with `valet stop`, and then restart it with `valet restart`.

My thinking is if its not running, its not using those conflicting functions.

---

<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:** [February 21, 2018, 2:57pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/7 "2018-02-21T14:57:43Z")

</div>

I don‘t have it running but the problem exists nevertheless.

---

<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:** [February 21, 2018, 3:14pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/8 "2018-02-21T15:14:43Z")

</div>

> [@texnixe](#):
>
> I don‘t have it running but the problem exists nevertheless.

Hmm thats a shame. Worth a shot though.

---

<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:** [February 21, 2018, 3:45pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/9 "2018-02-21T15:45:10Z")

</div>

@afincato If we don’t install the CLI globally but into its own separate folder and include the path in the $PATH variable (like I actually had it on my last Mac), we shouldn’t run into this conflict. See the CLI readme.

Edit: Just to let you know, I installed the CLI to another path, added the path to the $PATH variable and can now run both the CLI and Laravel Valet happily together.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [February 22, 2018, 2:45pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/10 "2018-02-22T14:45:30Z")

</div>

this is smart, indeed. did you try?

might give it a try in the coming days and will report back!

---

<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:** [February 22, 2018, 3:19pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/11 "2018-02-22T15:19:15Z")

</div>

> [@afincato](#):
>
> this is smart, indeed. did you try?

Yep, up till now it’s running without any problems. Make sure to close your terminal windows to pick up the changes.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [March 2, 2018, 3:33pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/12 "2018-03-02T15:33:17Z")

</div>

i’m giving this a go! on macOS, which custom folder did you choose to install kirby cli?

re: one of those `.dotfolder`?

---

<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:** [March 2, 2018, 3:50pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/13 "2018-03-02T15:50:51Z")

</div>

Just a standard folder in my user folder, in this case it is stupidly called vendor, but could be renamed to anything more useful like kirby\_cli or whatever you like.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [March 20, 2018, 12:02pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/14 "2018-03-20T12:02:43Z")

</div>

sorry to come back to this only now.

having problems with… setting up the correct path to the local folder of kirby-cli on my `.bashrc`.

this is all i have (that i am aware of), composer-related:

```auto
# --- composer
export PATH=$HOME/.composer/vendor/bin:$PATH
export PATH=$HOME/kirby-cli/vendor/bin:$PATH
export PATH=/Users/af-etc/.pyenv/shims:/Users/af-etc/.composer/vendor/bin:/Users/af-etc/.nvm/versions/node/v8.7.0/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/opt/fzf/bin:/usr/local/opt/go/libexec/bin:~/.local/bin
export PATH="/usr/local/sbin:$PATH"

```

the second line, which should link to the local package of kirby, it’s not working (i reloaded / quitted-repoened the terminal).

what’s a way to set it up correctly?

---

<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:** [March 20, 2018, 12:13pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/15 "2018-03-20T12:13:55Z")

</div>

In my case it looks like this:

```auto
alias composer="php /usr/local/bin/composer.phar"
export PATH=$PATH:~/.composer/vendor/bin
export PATH=$PATH:~/vendor/bin #this is where the cli lives

```

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [March 20, 2018, 12:28pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/16 "2018-03-20T12:28:34Z")

</div>

thank you. i updated it to

```auto
alias composer="php /usr/local/bin/composer"
export PATH=$PATH:~/.composer/vendor/bin
export PATH=$PATH:~/kirbycli/vendor/bin

```

adding `/vendor` between my kirbycli folder and the bin folder, as that’s how structured the folder.

composer and valet commands work perfectly, kirby still not.

---

<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:** [March 20, 2018, 12:32pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/17 "2018-03-20T12:32:17Z")

</div>

Really? In my structure, it looks like this:

![13](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/7/70ce65bbf3234e34ed7857af16a13386ae9a60a8.jpg)

This is the vendor folder I’m referring to in my path.

---

<div class="post-metadata">

**Author:** ![afincato](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/afincato/32/3446_2.png) [@afincato](https://forum.getkirby.com/u/afincato)\
**Post date:** [March 20, 2018, 1:10pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/18 "2018-03-20T13:10:26Z")

</div>

oh wait, i’m getting confused now.

![24](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/7/7a6086fd175cbba91540df982a838d98ffaeaea9.png)

---

<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:** [March 20, 2018, 1:15pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/19 "2018-03-20T13:15:45Z")

</div>

Well, maybe your vendor folder is inside a kirbycli folder, I don’t know…

---

<div class="post-metadata">

**Author:** ![krisa](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/krisa/32/3415_2.png) [@krisa](https://forum.getkirby.com/u/krisa)\
**Post date:** [March 20, 2018, 4:26pm UTC](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774/20 "2018-03-20T16:26:56Z")

</div>

Also having same problem. I would rather not make another composer folder. Isn’t it just matter of updating kirby-cli somehow?

[Next page](https://forum.getkirby.com/t/php-fatal-error-cannot-redeclare-dump/9774.md?page=2)
