Caching Problems

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
JoeMcManus

Caching Problems

Post by JoeMcManus »

Hi,

First of all credit where it is due. After trying many (including the usual suspect big boys joomla et al) FOSS CMSes I am very glad I went with CMSMS. I'm a pretty hardcore web dev guy but couldn't even work out how to add apage to Xoops. Go figure, your system is what my staff need! Thanks a lot.

All went well during installing and populating the site with content. Until I was just about to go live...

Vital Stats:

Version 0.13
CMS Mailer 1.73.9
FeedbackForm 0.9.12

Server: RHEL v3  - 2.4.21-32.0.1.EL Kernel
Apache 2.4.46
PHP 4.3.2
MySQL 3.23.58

Just before going live I changed all files' owenership (CHOWN, not CHMOD). That's when, after updating a page, I got this message (stripped of sensitive data)
Warning: fopen(/var/www/ourdomain.com/public/tmp/cache/contentcache.php): failed to open stream: Permission denied in /var/www/ourdomain.com/public/lib/classes/class.content.inc.php on line 2165

Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/ourdomain.com/public/lib/classes/class.content.inc.php on line 2166

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/ourdomain.com/public/lib/classes/class.content.inc.php on line 2167
By merely going ‘Site Admin’ > ‘Global Settings’ and clearing the cache, the error message (which appeared above the header) was gone. But it won't update anymore. In the back-end in remembers my changes when I apply or Submit them but they don't show on the front-end anymore. And I don't get any errors anymore either which makes it kind of hard to pinpoint the problem. I've cleared the cahce many times, manually removed /tmp/cahce's contents etc. but to no avail. Whatever changes I now make show in the back-end but never on the front-end.

The error message quoted tell me that there is a problem with the file permissions or ownerships. I've set the appropriate files (in tmp and lib) back to apache as the owner but still, no show of my updates on the fornt end. Which confuses the hell out of me because where does the front end get those old pages from if the back end already shows my edits? And yes, I have deleted my browser cache (tried it in FF, IE and Opera actually).

So I'm out of options and ideas on fixing this myself.

Do you guys have any ideas? New cache files are being written to /tmp/cache just fine but they contain old data, not what I see in the back-end. I have no idea where that old data is coming from. I'm not as au faix with this yet as I am with osCommerce for instance and i couldn't find cache related data in the database. Is the templates_c a cache folder perhaps? So if any of you have any pointers, I'd be very grateful.

Thanks.

Joe

PS Having re-read this, let me emphasize the main issue here: The error is gone since I cleared the cache but what remains is this: When in the back-end I edit a page, it records my edits just fine, shows them in preview etc. All signs are it's cool. But none of it shows in the front end. It shows the version prior to my edits in the front end. Back-end = up to date, Front-end = old even after clearing cache in the system and manually (removing content_cache.php). They seem to retrieve data front different sources...
JoeMcManus

Re: Caching Problems

Post by JoeMcManus »

Ironically, just after posting it I fixed it by renaming templates_c to old_templates_c and then making a new empty folder called templates_c with the necessary write permissions and the file user the same as the server. Voila, it worked.

Hope this helps anybody else whould you have the same problem...

Summary:

If you mass changed file ownership (because like me, you didn't want them to be root or whatever) be sure to enable whoever executes the scripts (apache in my case) can modify and delete the templates_c (templates cache) folder. This might involve leaving file and folder ownership as they were on those files.

Thanks for tuning in to my monologue - always a good way to start on a forum (n00b :D )
cyberman

Re: Caching Problems

Post by cyberman »

JoeMcManus wrote: be sure to enable whoever executes the scripts (apache in my case) can modify and delete the templates_c (templates cache) folder. This might involve leaving file and folder ownership as they were on those files.
Normally this should be checked in install procedure - perhaps this part should be modified  ::) ...
JoeMcManus

Re: Caching Problems

Post by JoeMcManus »

As it was by default after untarring the package, it worked. But to tighten security, I wanted to change ownership.

Perhaps a warning in the back-end (like osCommerce does) that checks permissions on the cache folders might help indeed. Then again, I didn't change permissions, only ownership so not sure whether PHP can check that properly.
gsalmeri

Re: Caching Problems

Post by gsalmeri »

JoeMcManus wrote: Thanks for tuning in to my monologue - always a good way to start on a forum (n00b :D )
Thank you very much for your monologue! I've had the same problem (after a machine upgrade of my ISP), I've followed your recipe and now all works flawlessly.
Locked

Return to “CMSMS Core”