The physical path to the book format is found by grabbing info out of the DB using the passed numeric primary key, and concatenating that info with the library path. Direct links should never work, because the library books should not be visible to the web server as files.
You are welcome to do whatever you want with the templates.
I can say that your installation is not one that is supported by the server, because it does not support php embedded in the URL and, by extension, $_SERVER['PATH_INFO']. That is what your web server is complaining about when it says ""No input file specified." Sorry, but I am not interested in doing any work to support what appears to be a broken (from my php code's point of view) configuration.