splitbrain / dokuwiki-template-twigstarter

Twig based starting template for DokuWiki
https://www.dokuwiki.org/template:twigstarter
1 stars 1 forks source link

Fatal Issue: Cannot redeclare ctype_digit() #1

Open issmirnov opened 4 years ago

issmirnov commented 4 years ago

Hello,

There is a fatal bug in this template:

2020/02/05 10:12:16 [error] 339#339: *47 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot redeclare ctype_digit() 

(previously declared in /app/dokuwiki/inc/compatibility.php:31) in 
/config/dokuwiki/lib/tpl/dokuwind/vendor/symfony/polyfill-ctype/bootstrap.php
 on line 18" while reading response header from upstream, client: 172.18.0.1, server: _, 

request: "GET /doku.php?id=start&do=admin&page=config HTTP/1.1", 
upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080", 
referrer: "http://localhost:8080/doku.php?id=start&do=admin&page=config"

Steps to reproduce:

  1. Clean install Dokuwiki
  2. Open Extension manager and install the twigstarter template
  3. Switch to the template in config settings

Analysis:

It seems that the compatibility.php logic is getting loaded first, and then when the vendor/symphony/polyfill code runs there's an issue with the ctype_digit function already being declared. I don't know enough about PHP load order or what symphony is for to provide useful debugging here.

splitbrain commented 4 years ago

what php version are you using?

issmirnov commented 4 years ago

PHP7 from this docker base in this image

splitbrain commented 4 years ago

ctype_digit should exist natively in PHP7 so neither compatibility layer should be loaded at all.

I notice that your error message is referring to a lib/tpl/dokuwind/ directory not lib/tpl/twigstarter.

issmirnov commented 4 years ago

I cloned twigstarter and renamed it to dokuwind for a WIP project. I checked in the same environment, and installing the twigstarter template through the extension UI seems to have the same issue.

issmirnov commented 4 years ago

I'm using the following docker config:

---
version: "2"
services:
  dokuwiki:
    image: linuxserver/dokuwiki
    container_name: dokuwiki
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
    volumes:
      - ./config:/config
    ports:
      - 80:80
    restart: unless-stopped

If this looks like a PHP issue, I can open an issue upstream on https://github.com/linuxserver/docker-dokuwiki