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
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.
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:
The go() function is already implemented in the following PHP versions or in one of its modules and therefore the error is thrown:
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.
Most helpful comment
@illycz Fix is coming to have swoole disabled by default as it is rarely used.