stat failed filemtime() Codeigniters assetlib-pro on a plesk server

I came across this error when I was trying to implementing the Assetlib-pro CodeIgniter library for adding assets etc to your project.

A PHP Error was encountered

Severity: Warning

Message: filemtime() [function.filemtime]: stat failed for

Filename: libraries/Assetlibpro.php

Line Number: 218

Now because of my setup from EukHost in the uk I use plesk as my admin system, which obviously has custom rules etc for how php and apache behave together and how they are setup. For some reason the assetlib code could correctly get to the styles I had defined in the assetlib config file – ‘/assets/’, but I had to manually change a line of code in the assetlib library file.


$mtimes[] = filemtime(dirname(FCPATH).'/'.trim($asset,'/'));


$mtimes[] = filemtime(dirname(FCPATH).'/httpdocs/'.trim($asset,'/'));

For some reason when the function filemtime went to do its thing it would try and run the function of this location ‘/var/www/vhosts/’ which is wrong as you can see its missing the ‘httpdocs’ after the domain name. I did change my assetlib config file to ‘/httpdocs/assets/’ but that didn’t work at all, the code seems to me to be wrong. However when i changed the code this fixed that specific problem and i can now use the library as it is intended, however I still can’t manage to get the compression aspect of the library working yet, I havent looked into yet but i’m guessing its just a pathing issue again.

Anyway I hope this can help people that have a similar setup to me, or are having the same issue.

Rough outline of my current setup:

Exit mobile version