Fuel cache library throwing errors (Fuel v1)

edited November 2013 in Share
Hi,

I've been fighting with a server that is using PHP as cgi, and noticing lots of permissions errors I've not encountered before with Fuel or CI.

I've got one issue (?) left to tackle - Cache.php in the Fuel module is complaining about not being able to open certain cache files (.cache and .exp) and outputting "permission denied" messages. I'm not sure these are critical, but something obviously isn't right - or ahem, write. The files don't seem to exist at all, so I assume they are not being written.

I've not noticed the errors in local development (wamp) but then again, I can't see the files being created locally either. Should I be concerned!?

Comments

  • edited 7:40AM
    Is the cache folder writable by PHP?
  • edited 7:40AM
    To an extent - the folder is 0771 (that's the most I can set via ftp), and Dwoo is writing to it OK.

    I've just discovered the constants file in /config, and am wondering what can be done with the settings there.
  • edited 7:40AM
    I'm wondering if it has to do with the 0777 permissions that are explicitly set in the MY_Parser.php file around line 93 and 94. Perhaps those should be changed to the "DIR_WRITE_MODE" constant set in the constants.php file.
  • edited December 2013
    I've just started a new Fuel project, and have a recent v1 download and I'm getting similar errors in the logs to the last project from the Fuel Cache library:

    ERROR - 2013-12-07 08:56:36 --> Severity: Warning --> unlink(D:/wamp2/www/subdomains/someproject/fuel/application/cache/b3b32a2d422265cd25c3323ed0157f81.group/c138fddf198b2f9cfdbc15f875bbe3f6.cache): No such file or directory D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Cache.php 209 ERROR - 2013-12-07 08:56:36 --> Severity: Warning --> unlink(D:/wamp2/www/subdomains/someproject/fuel/application/cache/b3b32a2d422265cd25c3323ed0157f81.group/c138fddf198b2f9cfdbc15f875bbe3f6.exp): No such file or directory D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Cache.php 210 ERROR - 2013-12-07 08:56:36 --> Severity: Warning --> chmod() expects parameter 1 to be a valid path, resource given D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Cache.php 170 ERROR - 2013-12-07 08:56:36 --> Severity: Warning --> chmod() expects parameter 1 to be a valid path, resource given D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Cache.php 171

    This is in a WAMP enviroment and MY_Parser already has the DIR_WRITE_MODE change in it (SHA 49160b0306d2eb8033a30a30c1697c8c0b666e15).

    Additionally, these are also popping up a lot:
    ERROR - 2013-12-07 10:38:49 --> Severity: Warning --> Illegal string offset 'attrs' D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Asset.php 730 ERROR - 2013-12-07 10:38:49 --> Severity: Warning --> Illegal string offset 'output' D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Asset.php 736 ERROR - 2013-12-07 10:38:49 --> Severity: Warning --> Illegal string offset 'output' D:\wamp2\www\subdomains\someproject\fuel\modules\fuel\libraries\Asset.php 739

    I've got rid of the Cache lib errors by using is_file() tests around the cache files in lines at issue. The Asset errors are probably to do with using the js() helper with no attributes or output - as per the Fuel footer default.
  • edited 7:40AM
    Thanks for the info. I've posted some changes to the Cache library per your suggestions. For the Asset issues, do they go away if the default value for the js and css functions for the 3rds 'options' parameter is set to NULL instead of "array()"?
  • edited 7:40AM
    After thinking about this a little more, I don't think my suggestion will work. I think the change is actually to the asset_helper and making the default 3rd parameter an array instead of an empty string. I've posted a fix for that in the repo.
Sign In or Register to comment.