Page 1 of 1
[phpBB] Permission denied (cache)
Posted: Mon Jan 26, 2009 1:06 pm
by cpreston
My site got hacked, so I had to rebuild things. phpbb2 is working without magic seo, but when I renable it, it works like this:
1. Forums and old posts open just fine.
2. New posts generate an error when you open them. The browser says this:
Warning: fopen(/home/cpreston/public_html/phpBB2/cache/fancy-data/phpbb-topics-95705) [function.fopen]: failed to open stream: Permission denied in /home/cpreston/public_html/phpBB2/includes/magic_seo_url.php on line 1268
I've checked the following:
1. fancy-data is set to 777
2. The file it's trying to open is there, and it's permissions are 644
Help! My board is a very popular part of my site.
Re: [phpBB] Permission denied (cache)
Posted: Mon Jan 26, 2009 1:21 pm
by cpreston
I answered my own question.
The problem was that I had restored the board to a point in time BEFORE the hack happened. I also restored the fancy-data directory, but I didn't remove it first. The result was that there were some cache files that referenced posts that didn't exist. Then when someone created a new post that generated the same post ID, magic SEO opened the same file name, appended the data to the file, thus generated a single file with multiple post entries in it. All I had to do was delete any cache files that were generated since the point in time the restore was done from. Magic SEO recreates the cache files.
FWIW, I think this could also be addressed in the code. When making a cache file for a new post (when the post is made), there could be a check to see if the file already exists. If it does, the file should be removed then recreated.
Re: [phpBB] Permission denied (cache)
Posted: Mon Jan 26, 2009 4:31 pm
by inveo
This problem was caused by incorrect permissions of cache files. Obviously, Magic SEO URL has no problem when cache file already exists (than is updated), but because you have uploaded all cache files with incorrect permissions, this action cold not be performed and therefore you received error message "Permission denied".