Hi,
I'm running SimpleSAML on an environment whereby PHP will have an extension [1] to disallow the use of eval() for security reasons.
It turns out that Twig uses eval() as a last resort when it is unable to load its templates from cache; you can read more about that here [2].
SimpleSAMLphp does not use Twig template caching by default, meaning that indeed, I hit this error on either an SP or an IDP using SimpleSAMLPHP:
Jun 22 01:35:30 b8397ee50592 simplesamlphp[23168]: PHP Fatal error: DISEVAL - Use of eval is forbidden in /path/to/simplesamlphp/vendor/twig/twig/src/Environment.php(497) : eval()'d code on line 15
The config.php and documentation suggest that Twig template caching can be turned on by setting 'template.cache' to an absolute path that PHP/the webserver can write to. However, when I do so, no cache data is generated, and the issue does not go away. It's not a permission issue or anything - simply no change in behavior whatsoever.
It's strange, I looked at the source code [3] and I can see how $cache is being set. But if I change that variable $cache to be a hardcoded string, it *still* doesn't seem to set cache.
Is it maybe not setting cache the right way anymore (whereas maybe in an earlier version of Twig it worked that way?) Does anyone else have this working as per the notes in the config.php ? I've tested it in SimpleSAML 1.17 and 1.19 with no luck
Thanks for any assistance!