Hi there,
i think a found a bug (i absolutely cannot reproduce this on non docker environments, but it is definitely there) related to the used type of $less->importDir[]...
i don't think it should be an array.
This causes my css.php to fail: output of the file is just
<br />
<b>Fatal error</b>: Uncaught Error: [] operator not supported for strings in /var/www/html/lib/exe/css.php:169
Stack trace:
#0 /var/www/html/lib/exe/css.php(140): css_parseless('@ini_text: #333...')
#1 /var/www/html/lib/exe/css.php(18): css_out()
#2 {main}
thrown in <b>/var/www/html/lib/exe/css.php</b> on line <b>169</b><br />
Removing [] made it work for me.
I tested this with
Apache/2.4.10 (Debian) PHP/7.1.0
Apache/2.4.10 (Debian) PHP/7.0
Apache/2.4.10 (Debian) PHP/5.6
I had the issue on every containerized environment.
(I'm using this dockerfile)
I am not sure why, but the linked docker file replaces lib/exe/css.php with their own version. That's probably the reason why it behaves differently only in docker.
That's the fix for the dockerfile. I simply added a corrected version of the css.php so that the container will actually work as intended.
I didn't notice that this seems to be your Docker image.
lessc.inc.php declares $importDir as string|string[] and indeed uses it as (array)$this->importDir.
However I guess the problem might be that it is never initialized as an array. Though I wonder why this doesn't throw any problems outside your docker image. Actually I think this should be a notice not an error...
Yeah that's quite interesting indeed. We also use a non-docker productive dokuwiki and there is no issue with that as well. 馃槻
http://i.imgur.com/s9JTJSX.png that's what i see btw. with the $less->importDir[] version.
I pushed a fix. Could it be that the PHP image you use for some reason sets a config option or something that converts warnings to exceptions?
That is highly unlikely i guess. The base image is the offical php:7.1-apache image but i cannot find weird stuff there right now nor can i say anything definite about config options that would convert warnings. It's pretty basic afaik.
I think this should be pushed as a hotfix, since the stable release with PHP7 is crashing like the imgur picture @ununseptium provided.
Iam using PHP 7.1.1 and [] worked for me as well.
Otherwise the layout got messed up and things got broken.
I am testing Dokuwiki with Apache 2.4.25 and PHP 7.1.1 and I had to change:
function css_parseless($css) {
global $conf;
$less = new lessc();
$less->importDir[] = DOKU_INC;
$less->setPreserveComments(!$conf['compress']);
to
function css_parseless($css) {
global $conf;
$less = new lessc();
$less->importDir = DOKU_INC;
$less->setPreserveComments(!$conf['compress']);
to get stylesheets to work.
Can verify that this is indeed an issue on Ubuntu 18.04.1 LTS as well, importDir[] should be importDir for templates to work (otherwise there's a 500 error thrown by apache and :
[Fri Aug 17 10:23:07.956448 2018] [php7:error] [pid 20149] [client 157.157.42.1:41810] PHP Fatal error: Uncaught Error: [] operator not supported for strings in /usr/share/dokuwiki/lib/exe/css.php:169\nStack trace:\n#0 /usr/share/dokuwiki/lib/exe/css.php(140): css_parseless('@ini_text: #333...')\n#1 /usr/share/dokuwiki/lib/exe/css.php(18): css_out()\n#2 {main}\n thrown in /usr/share/dokuwiki/lib/exe/css.php on line 169, referer: https://localhost/doku.php
This has been fixed since years! Update your DokuWiki.
This is in the latest version that installs with Ubuntu 18.04 LTS.
Me complaining to Canonical does nothing. If someone authoritative for the software points it out, it might help.
Don't install the debian package. It's notoriously outdated. Just download the official package and follow the installation instructions.
Most helpful comment
I am testing Dokuwiki with Apache 2.4.25 and PHP 7.1.1 and I had to change:
to
to get stylesheets to work.