Devilbox: Kirby CMS Error

Created on 20 Aug 2018  ·  9Comments  ·  Source: cytopia/devilbox

ISSUE TYPE

  • Bug Report

OS / ENVIRONMENT

  1. Host operating system: macos high sierra
  2. Native Docker or Docker Toolbox: native docker
  3. Docker version: Version 18.06.0-ce-mac70 (26399)
  4. Docker Compose version: 1.22.0, build f46880f
  5. What containers are running: all
  6. Container versions:

SUMMARY


When I try run my existing Kirby CMS website (https://github.com/getkirby/kirby) I get Fatal error: Cannot redeclare go() in /shared/httpd/pardus-bike/pardus-bike/kirby/vendor/getkirby/toolkit/helpers.php on line 29. I 'm not a developer so I don't understand where is the problem. Everything works in MAMP...

Thanks

STEPS TO REPRODUCE

EXPECTED BEHAVIOUR

ACTUAL BEHAVIOUR

OTHER INFORMATION

documentation

Most helpful comment

@illycz Fix is coming to have swoole disabled by default as it is rarely used.

All 9 comments

Can you provide some more details on the PHP/Webserver versions you use, also do you have any custom configs in place? How did you install kirby? I need to be able to reproduce your exact environment.

  1. Latest installation of Devilbox and Kirby CMS.
  2. My actual env: https://gist.github.com/illycz/de201a23240b0c57336e23d8d6a4bc8f (I tested also default setting with same result)
  3. Kirby is cloned from Github and folder structure is same as in WordPress tutorial (htdocs symlinked to Kirby)

Something else?

Thanks a lot!

Please provide more detailed instructions for how to set it up the way you did it. I currently have:

/shared/httpd/ $ mkdir kirby
/shared/httpd/ $ cd kirby
/shared/httpd/kirby $ git clone https://github.com/getkirby/kirby
/shared/httpd/kirby $ ln -s kirby htdocs
/shared/httpd/kirby $ tree -L 1
.
├── htdocs -> kirby
└── kirby

2 directories, 0 files
/shared/httpd/kirby $ curl -I kirby.loc/
HTTP/1.1 404 Not Found
Date: Wed, 22 Aug 2018 10:58:18 GMT
X-Powered-By: PHP/7.2.8
Content-Type: text/html; charset=UTF-8



md5-0d36990ec789307336f5e4dce618bc45



$ find . -name 'index.php'

does not find anything.

Where should the symlink point to and how to get the index.php

It's better clone starterkit: git clone --recursive https://github.com/getkirby/starterkit.git kirby.
Kirby uses submodules for Core and Panel (administration interface).

I think you clone only Core of Kirby...

@illycz the function go() is already provided by PHP or some of its modules.

You can reproduce this If you simply create a new empty project with an index.php

<?PHP

function go() {
        echo 'test';
}
go();

You will also get this error:

Fatal error: Cannot redeclare go() in /shared/httpd/test/htdocs/index.php on line 5

So its a function name collision

The go() function is not available in the following PHP version, therefore those dont throw an error:

  • php 5.2
  • php 5.3
  • php 5.4
  • php 5.5
  • php 5.6

The go() function is already implemented in the following PHP versions or in one of its modules and therefore the error is thrown:

  • php 7.0
  • php 7.1
  • php 7.2
  • php 7.3

How to fix

I figured it. The go() function is already implemented in recent versions of swoole

So in order to mitigate this issue, simply disable swoole in env like so:

PHP_MODULES_DISABLE=swoole

I will keep this open until I have added it to the troubleshooting documentation

Fantastic! Thanks for your investigation work :)

@illycz Fix is coming to have swoole disabled by default as it is rarely used.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

folkevil picture folkevil  ·  5Comments

gowrav-vishwakarma picture gowrav-vishwakarma  ·  6Comments

lostncg picture lostncg  ·  3Comments

normance picture normance  ·  4Comments

msyhr picture msyhr  ·  7Comments