Dokuwiki: PHP embedded webserver can't serve page with a dot in the name.

Created on 11 Jun 2020  路  5Comments  路  Source: splitbrain/dokuwiki

Hi,

Because PHP has a strange behaviour with requests that have a dot in the name, it cannot serve pages whose name has a dot.

How to reproduce.

  1. php -S 127.0.0.1:8000 index.php
  2. point your browser to http://localhost:8000/this.is.broken
Bug

All 5 comments

What error message do you see? Do you expect PHP to use htaccess config? What about localhost:8000/index.php/this.is.broken?

on my laptop, I run my own personal wiki with php -S 127.0.0.1:8000 index.php

I use $conf['userewrite'] = '1'; (as stated in index.php itself). This works great. pages, media, plugins, templates, forms... Everything just works so great.

But as soon as you use a pagename with a dot :

  • php produces an empty answer
  • As already written, no error at all :

    • The php commands prints no error, just

      DW-engine (0) $ php -S 127.0.0.1:8000 index.php [Thu Jun 11 22:05:38 2020] PHP 7.4.6 Development Server (http://127.0.0.1:8000) started [Thu Jun 11 22:05:43 2020] 127.0.0.1:49217 Accepted [Thu Jun 11 22:05:43 2020] 127.0.0.1:49217 Closing

    • No error in the navigator, just an empty page.

To answer your last question http://localhost:8000/index.php/this.is.broken works. But it is useless. If I create a page with this syntax [[:this.is.broken]], it won't create such a link.

Seems to be caused by this bug: https://bugs.php.net/bug.php?id=61286 which has been closed as won't fix. There seem to be some work arounds... I'll investigate.

Thanks for the quick reaction.

This brings an unexpected behaviour with http://127.0.0.1:8000 or http://127.0.0.1:8000/. Previously, it would load the start page, now it tries to load the page index.php. Actually, http://127.0.0.1:8000/index.php does not run index.php but loads the page named index.php.

I would still point /index.php to that exact page rather than the start page (edit: I saw the behavior of doku.php and this is probably worth fixing), but the root part is definitely worth fixing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

epeios-q37 picture epeios-q37  路  4Comments

schplurtz picture schplurtz  路  6Comments

systemofapwne picture systemofapwne  路  6Comments

michitux picture michitux  路  5Comments

wangxu94 picture wangxu94  路  5Comments