I am trying to get the Catalyst
framework to work using Template Toolkit
, and I'm having issues with Template::Provider
. I've isolated the issue to calls to stat
. In Template::Provider::_init
, calls to stat
work correctly, however in other functions calls to stat return []. It seems like Template::Provider
is doing some weird caching stuff, but I can't quite figure out what. Anyone have any ideas?
EDIT: A bit more detail:
I'm trying to move from the Catalyst development server to Apache/mod_perl. I get a Couldn't render template "file error - mytemplate.tt: not found"
error. Here is the debug dump of my config:
Config
do {
my $a = {
"Action::RenderView" => {
ignore_classes => [
"DBIx::Class::ResultSource::Table",
"DBIx::Class::ResultSourceHandle",
"DateTime",
],
scrubber_func => sub { "???" },
},
"Plugin::ConfigLoader" => {},
home => "/home/myuser/pathtosite",
name => "Stream",
root => bless({
dirs => ["", "home", "myuser", "pathtosite"],
file_spec_class => undef,
volume => "",
}, "Path::Class::Dir"),
static => {
debug => 1,
dirs => [],
ignore_dirs => [],
ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"],
include_path => ['fix'],
mime_types => {},
mime_types_obj => bless({}, "MIME::Types"),
no_logs => 1,
},
};
$a->{static}{include_path}[0] = $a->{root};
$a;
}
Pretty much the exact same issue that someone described here: http://www.gossamer-threads.com/lists/catalyst/users/14888
Assuming your files are actually in the /home/myuser/pathtosite
directory (and not a subdirectory), this seems like it could be a perimssion problem with the Catalyst process not being able to read the files there. If you're running in an SELinux environment, it could also have to do with the security context (e.g., security context type httpd_sys_content_t
).
Can you do some debugging to ensure that the files are visible from the Catalyst process in the first place, before it attempts to render the template?