Topic: Must the cache be chmod'ed to 777?

Is there anyway around this?

I get this error when I try and install:

Warning: fopen(./cache/cache_config.php): failed to open stream: Permission denied in D:\Web-server\deadllamas.net\wwwroot\forums\include\cache.php on line 89
An error was encountered
File: D:\Web-server\deadllamas.net\wwwroot\forums\include\cache.php
Line: 91

PunBB reported: Unable to write configuration cache file to cache directory. Please make sure PHP has write access to the directory 'cache'

I ask this because I installed phpbb with similar issues previously and it gave me a work around so I was wondering if there is anything I can do so I can use punbb.

Please help

Re: Must the cache be chmod'ed to 777?

It must not be chmod'ed to 777. It must be chmod'ed and/or chown'ed so that PHP can write to the directory. Whatever that is on your server is impossible for us to say.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Must the cache be chmod'ed to 777?

Right now the folder is 666 which is 'read' 'write' across the board [user, group and public] but not execute and I still get the error.

How do can I find out if php can write to a directory?
Will I find that in phpinfo() ?

I can post the url for my phpinfo() page if it helps (is that safe? I have no idea!)

Thanks.

Re: Must the cache be chmod'ed to 777?

"Warning: fopen(./cache/cache_config.php): failed to open stream: Permission denied in D:\Web-server\deadllamas.net\wwwroot\forums\include\cache.php on line 89"

That means it does not have permission. Have you tried 777 then?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Must the cache be chmod'ed to 777?

Unfortunately that is the problem. I can not change it to 777 only 666 and below due to restricted access by my host.

6 (edited by Tobi 2005-09-01 17:07)

Re: Must the cache be chmod'ed to 777?

That is strange.
777 means rwxrwxrwx for files and
rwXrwXrwX for directories.
While "x" normally means execute rights the capital X just means the right to open this directory.
And of course php cannot write to a directory that it can't open.

Then again, a directory with the permission
666 translates to
rw-rw-rw- which means nobody can open it (well, Mr. root can of course...)

As it makes sense for your host to restrict the usage of the execute bit on files I think forbidding the execute bit on directories makes his service absolutely unusable smile

So either you got something wrong there or your host is amongst the strangest of all strange hosts I know so far.

The German PunBB Site:
PunBB-forum.de

Re: Must the cache be chmod'ed to 777?

I use the chomd ability in both cuteftp and filezilla to 777 the directory but it never changes it always stays at 666 [it says (drw-rw-rw) on all the folders].
I do not have shell access to the host so I have to go in via ftp only (as far as I know).

Any help would be appreciated.

8

Re: Must the cache be chmod'ed to 777?

No shell access? Can't change directory permissions?
Then change host.
Sorry. That's really all I could say.
This problem you will have with any board, not just punBB. They all require some dirs to be world readable.

The German PunBB Site:
PunBB-forum.de

9 (edited by mikepurvis 2005-09-01 17:59)

Re: Must the cache be chmod'ed to 777?

It definitely needs execute privs, since the cache contains files with PHP code in em.

If you can't set it to 777, can you chown it to the php user? (or else write a quick php script to "mkdir" a dir called cache somewhere that you can write, and then move it to the PunBB folder...)

Re: Must the cache be chmod'ed to 777?

How do I chown the folder [what's the best program to use?] and how do I find out what the php user is?
Also I don't know any php so if you could provide me with a mkdir script I would be very greatfull.

I'm really sorry about the questions/requests! [I'm better at css then I am at forum/database malarky, once the forum works and I'm done with it I'm sure you guys will love it smile ]

11

Re: Must the cache be chmod'ed to 777?

mikepurvis wrote:

can you chown it to the php user?

Most *NIX Systems do not allow a user to chown something to another user, let alone the webserver user. Security issue.
Don't think that will work

Radiant wrote:

Also I don't know any php so if you could provide me with a mkdir script I would be very greatfull.

<?
mkdir("/path/to/your/cache",0777);
?>

Save it as let's say "mkdir.php" in your installation directory and call it from a browser.

You'll have to remove the old cache dir first of course

The German PunBB Site:
PunBB-forum.de

Re: Must the cache be chmod'ed to 777?

Thanks for that Tobi.
Unfortunately I got this error:

Warning: mkdir(cache): Permission denied in D:\Web-server\deadllamas.net\wwwroot\forums\mkdir.php on line 2

Ok so PHP not being able to write to the working directory is the problem and getting the admin to make the directory writable [by PHP] or make the directory chmodable above 666 are the only answers?

If that's correct then I'll need to talk to the admin which is bananas because I don't speak Danish!