dokuwiki on Windows - Undefined array key "fperm"

Created on 15 Jan 2021  路  6Comments  路  Source: splitbrain/dokuwiki

Hallo

I have Windows 10 with installed Apache 2.4 and PHP 8.0,0 as module (not cgi).
When I first launch dokuwiki I got these errors on the page (and in my php_errors.log):

[15-Jan-2021 15:32:19 Europe/Berlin] PHP Warning:  Undefined array key "fperm" in C:\Apache24\htdocs\dokuwiki\inc\init.php on line 343
[15-Jan-2021 15:32:19 Europe/Berlin] PHP Warning:  Undefined array key "fperm" in C:\Apache24\htdocs\dokuwiki\inc\io.php on line 255
[15-Jan-2021 15:32:19 Europe/Berlin] PHP Warning:  Undefined array key "fperm" in C:\Apache24\htdocs\dokuwiki\inc\io.php on line 255
[15-Jan-2021 15:32:19 Europe/Berlin] PHP Warning:  Undefined array key "fperm" in C:\Apache24\htdocs\dokuwiki\inc\io.php on line 255

So this is what I do:

  1. I download the latest stable (2020-07-29) from here (github).
  2. I copy its contents into my DocumentRoot of Apache 2.4 under /dokuwiki
  3. I launch https://localhost/dokuwiki
  4. I get these errors.

Now I reload the page and the errors has gone.
But when I edit the page the error is back, only one error of that kind, and gone agian, when I reload.
So each time I load a new page I see the error about this undefinded config[fperm] and when I reload that very page the error doesn't show (but shows again, on next launch).

When I comment out the line 255 of io.php as such:

// if(!$fileexists and $conf['fperm']) chmod($file, $conf['fperm']);

the error is not throwing, but I guess this is not the right solution ;)

I asked already in the forum: DokuWiki on Windows without WAMP etc.

Thanks.
frank

Bug good first issue

All 6 comments

php 8 won't work for dokuwiki as is noted in the requirements: https://www.dokuwiki.org/requirements

Do you think the errors are related to the PHP version?
Then I would change to 7.4 and retry, but I doubt it is about PHP version :(

This is definitely a PHP 8 issue, and not just under Windows - I'm getting the same error on my Ubuntu dev box.

The installer displays this message on top of page
Warning: Undefined array key "fperm" in /tmp/dokuwiki/inc/io.php on line 255

This issue should be tagged _PHP 8_

Could changes in last release influence this as well?
https://github.com/splitbrain/dokuwiki/pull/2985/files

@Klap-in I think you're right. That change assumes that $conf['fperm'] exists, but it might not:

https://github.com/splitbrain/dokuwiki/blob/7347c7c107a0885329924cdcad9bec872eefd339/inc/init.php#L398-L421

We unset it first and then only set it when the umask disagrees with what is configured.

I guess the proper fix is to initialize it as false or null instead of unsetting it.

I reached the same conclusion, will provide PR.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chang-zhao picture chang-zhao  路  4Comments

qezwan picture qezwan  路  3Comments

BenoitPoulet picture BenoitPoulet  路  3Comments

selfthinker picture selfthinker  路  6Comments

splitbrain picture splitbrain  路  4Comments