BandwidthD PHP files

I have bandwidthD working using a remote database on a PI 3 but I can not get these PHP files to work. If I install them on the router they wont execute. Only the index.php does if I move them to root they work but the graph.php file gives a 0 bytes so no charts. Why does php not wok in subdir?

Cant really install them on another server because no where is there any docs on what dependencies they need. Does anyone have the commands to install dependencies on ubentu or pi.
How does anyone get this working where is the documentation on installing the PHP files. Does anyone actually have these files working on the router where it installs them.

What tutorial/link are you following?