Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning: filemtime(): stat failed for missing file #341

Closed
stephanlueckl opened this issue Mar 3, 2017 · 2 comments
Closed

PHP Warning: filemtime(): stat failed for missing file #341

stephanlueckl opened this issue Mar 3, 2017 · 2 comments

Comments

@stephanlueckl
Copy link

It seems not to have a big effect - but the error logs are full of this messages:
PHP Warning: filemtime(): stat failed for /var/www/^773307d3849ef0eee2c6c9cc5512e49c169fe1c8_0.somefile.tpl.php in /var/www/smarty/libs/sysplugins/smarty_template_resource_base.php on line 154

It happens on a server with heavy load while cleaning the cache.
We have turned off the compile check (Smarty Version 3.1.31)

uwetews added a commit that referenced this issue May 21, 2017
…plate() from

    ACP cache if present, add some is_file() checks to avoid possible warnings on filemtime()
    caused by above functions.
    #341
@uwetews
Copy link
Contributor

uwetews commented May 21, 2017

You can mute expected errors by calling

Smarty::muteExpectedErrors();
However I added some additional is_file() checks which should also solve the problem.
The fix is now in the master branch and will later be included in version 3.1.32

@uwetews uwetews closed this as completed May 21, 2017
@blaaat
Copy link

blaaat commented Nov 12, 2018

I'm seeing this warning occur a lot recently (I assume after PHP or kernel updates). Happens both after emptying the templates compile directory and on regular cache hits.

filemtime(): stat failed for
smarty/smarty/libs/sysplugins/smarty_internal_cacheresource_file.php:69
Smarty_Internal_CacheResource_File::populate

Appears that there is a race condition between the is_file and filemtime?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants