mkdir templates_c and chowning to www-data doesn't work for me and many other users.
Still the same problem on Debian 10. ln -s templates templates_c (outside public folder) and setting ownership to www-data fixed it.
Still the same problem on Debian 10. ln -s templates templates_c fixed it.