esek/evote

Doesn't work in non-root folders

Closed this issue · 1 comments

The system fails when not installed in the $_SERVER['DOCUMENT_ROOT'] folder.

Reproduce the problem:

  1. Create a PHP-server
  2. Create a subfolder
  3. Install the system in the subfolder
  4. Get the error failed to open stream: No such file or directory

This is because of line 4 in data/evote.php, and could probably be fixed by changing

include $_SERVER['DOCUMENT_ROOT']."/data/config.php";

to

include "../data/config.php";

Could you give an example why the system shouldn't be installed in a subfolder? This should be an easy fix, but it does create a more static structure (which actually could be a good thing)`

Edit: Looking at this, my proposed fix is actually used in other files! I will create a branch to fix this, as it should have been consistant.