-
2005-03-03
pavlik
Hello, I completely followed install instructions, chmodded all important files and directories, but this is the result:
http://wiki.bozideti.com/test/doku.php?do=check&id=wiki:dokuwiki . I always get an error message about .cache directory. I also tried to create this one but the error persists.
On the system requirements page I found a notice that DokuWiki works fine under safe mode but it doesn't look like true.
Possible solution: never use mkdir in the code directly but use ftp_* functions to operate on webserver's filesystem (this is also a clear recommandation from my webhoster). Use mkdir directly only when FTP is down.
-
2005-03-03
andi
From:
http://www.php.net/manual/en/function.mkdir.php
Note: When safe mode is enabled, PHP checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed.
Can you change the owner of the DataDir to the webserver user? I think using the ftp_* functions is an ugly hack... I'll think about a solution.
-
2005-03-03
pavlik
I'm a Windows user so I don't know Linux environment well. How can I change owner? How do I realize whats the name of webserver user?
I know the only thing - when I go step-by-step thru the installation process, DokuWiki doesn't work. "FTP hack" is the only recommended way by my webhoster so I have a good reason to believe him.
FYI, this is output of Total Commander direcotory properties (directory called "data"):
drwxrwxrwx 3 public.bozideti.com nobody 4096 Mar 3 18:19 .
drwxrwxrwx 12 public.bozideti.com nobody 4096 Mar 3 15:39 ..
-rw-r--r-- 1 public.bozideti.com nobody 33 Mar 3 15:38 .htaccess
drwxrwxrwx 2 public.bozideti.com nobody 4096 Mar 3 15:38 wiki
-
2005-03-03
pavlik
I tried to install DokuWiki on webhosting with PHP4 (my regular hosting runs on PHP5) and voila - it works. Maybe there is some difference in safe mode in PHP4 and 5? But this issue definitely needs a closer look - it is absolutely frustrating when you can't install this wonderfull software :)
-
2005-03-03
andi
If you have FTP access only I think there is no way to change the owner :-( You could ask your hoster to do it for you. I read something more on this topic and I believe the FTP hack is indeed the only solution. I will add optional usage of it.
-
2005-03-03
pavlik
Nice to hear you will fix this. In my own script on that host, it was quite simple to reimplement this. You only need to create some web server <-> ftp server mappings (e.g. "/www/" maps to "/", this must be easily configurable), use it in your own filesystem functions and finally perform replace in files. Hope it will be implemented in next release.
P. S. Let me congratulate you for this excelent wiki. Makes my life happier :)
-
2005-03-07
andi
The current development version has support for this (called $conf[safemodehack]). I can not really test it so it would be nice if someone could try the devel versions (which may be broken sometimes) and give feedback on this feature.
-
2005-03-12
benpollinger
My webhost relaxed UID checking to GID (i.e. user to group) which worked for me. Using PHP version 4.3.10 on Plesk 7
-
2005-03-18
andi
I'd appreciate if anyone could give feedback if this hack does work as expected. It is coded blindly without any possibility to test so any feedback if most welcome!
-
2005-03-20
pavlik
How to get current development version? I could give some feedback.
But there is yet another way: simply look for some php5 free hosting (in my country the perfect example is php5.cz) and there is a big chance that hosters won't change PHP's default safe mode settings. You can try it yourself.
-
2005-03-25
andi
-
2005-04-07
Styno
Andi, I've put the last version (dokuwiki-2005-04-07.tgz) on a server of a webhoster with safemode enabled and the problem persists.
Error: "Writing /home/Sites/Customers/webtools.wl500g.info/web/dokuwiki/data/_cache/1008b7a6b1070e3cfeb3ab28b9cfddb9 failed"
-
2005-04-07
andi
Did you enable the safemode hack?
-
2005-04-08
Styno
Yes, I've set the option to '1' ($conf['safemodehack'] = 1;). I've not changed anything else.
-
2005-04-08
andi
Well did you add your FTP credentials into the $conf['ftp']... variables? Did you get any error messages? Maybe your $conf['ftp']['root'] option is wrong and the directories were created in the wrong location?
-
2005-04-08
Styno
Hmm, well it seems I was a bit quick with my conclusion, sorry for that. I just did a chmod 777 on the '/data', '/attic' and '/media' directorys, and now the error is gone. Even the older version 2005-02-18 works properly. Thanks for the support.
-
2005-04-22
vojtec
Im running on PHP5 with safemode on and still have cache problem - safemodehack is turned on, in ftp cred. im not sure with the 'root' variable - does it mean absolute path to the docuwiki? btw, if I set the 'root' variable to soever value, every time when I reload the page with DocuWiki, directory _cache is created at right place... have you some hint, what can i do with it? thax
-
2005-04-22
andi
I just had another look at the code and saw the root var wasn't used at all. I just comitted a patch - please try the current devel version.
For clarification here is how the root option works: When DokuWiki tries to create a path it strips the root part from this path when creating th path over FTP.
Example:
Imagine you installed dokuwiki in '/home/user/htdocs/dokuwiki' with '/home/user/htdocs/dokuwiki/data' as data path. When you log in with FTP you are chrooted to '/home/user'. Then you should set your $conf['ftp']['root'] to '/home/user/'. So if DokuWiki tries to create the directory '/home/user/htdocs/dokuwiki/data/mynamespace' the safemode hack strips the root part -> 'htdocs/dokuwiki/data/mynamespace' and will create this directory via FTP.
(I'll add this to the wiki, too)
-
2005-04-22
vojtec
I just tried the patch, set up correct $conf['ftp']['root'] and got another errors:
Creating directory /DISK3/WWW/vojtec.net/dokuwiki/data/_cache/instructions failed
Writing /DISK3/WWW/vojtec.net/dokuwiki/data/_cache/instructions/8474fa6da7b7528ec011a6a3a7e5658d failed
Creating directory /DISK3/WWW/vojtec.net/dokuwiki/data/_cache/xhtml failed
Writing /DISK3/WWW/vojtec.net/dokuwiki/data/_cache/xhtml/8474fa6da7b7528ec011a6a3a7e5658d failed
Problem with some rights?
-
2005-04-22
andi
I removed some silencing of the FTP commands, can you try the latest version and send back the errors you get?
-
2005-05-12
benpollinger
Just tried release 2005-05-07 on the same server as I mentioned above. These instructions were very useful:
http://wiki.splitbrain.org/wiki:safemodehack
I had to create the /attic dir and chmod it to 777. I think I also had to re-create the /data/_cache/xhtml and /data/_cache/instructions dirs, then chmod them to 777.
All seems fine so far - great work Andreas!
-
2005-07-11
andi
reopened because of additional feedback...
-
2005-08-07
ionos
Unfortunately, the sentence "When safe mode is enabled, PHP checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed." is not al that helpful -- do the two have to be the same, or must they not be the same (it only "checks", but it doesn't tell us what result is expected from this checking). This safemode can really be a pain in the beep.
Anywho, turns out that they the directory should not be owned but the Apache user (let's call him wwwuser), if I'm not mistaken. I uploaded all the files by ftp, the ftp-user being named ftpuser. The directory 'cache' is therefore owned by ftpuser, not wwwuser - thus wwwuser _can_ create the purgestats file, for example. The cache-subdirectories a through z and 0 through 9 are created by wwwuser however, so apache cannot operate within them.
So I created all the cache directories by hand, uhm, by ftp, as user ftpuser. Now, as the cache-subdirectories are owned by ftpuser as well, wwwuser can happily create its little cache files ... As long as only one level of cache directories is needed, this should work fine.
-
2005-08-07
rjad
I tried the safemode hack, but my server says "FTP support not found - safemode workaround not usable", which is a bit of a bummer. I looked at the comments above, and found similar thing as Ben and CO, in that if I create the cache directories by hand, things work ok, but only if I chmod them to 777. I think that the cache is owned by ftpuser since I ftp'ed them there, but I can't work out who should own the cache directories. Using chmod 777 seems a bit insecure to me. Note I only have ftp access to this server.
-
2005-08-07
andi
@CO: Thanks for the clarifications. However if you use the safemodehack (not sure if you did) then the cache directories should be created through FTP (the same as if you do it yourself) so they should have the correct owner (ftpuser).
@Robert: I guess you're out of luck then. Because:
@both: creating the cachedirs manually is no solution. DokuWiki needs to create new directories for namespaces as well, these are created when needed - there is no way for you to create them in advance.
-
2005-08-14
DS
I have been struggling with the same issues have tried everything, followed all possible paths. Nothing seems to work. My web host claims that an .htaccess file with the following lines in it would work but it does nothing:
Options +FollowSymlinks
RewriteEngine On
Would any .htaccess commands work for this?
If I can turn Safe mode off, would that immediately solve the issue? (my webhost is very reluctant but I might be able to)
-
2005-09-08
Dingsi
Hi,
I had this problem too.. Writing *cache* blah blah failed. Solved with activating safemodehack. But then, when I tried to create a new page this appeared:
Writing /var/www/html/web134/html/burg/data/pages/projects/rm2k.txt.lock failed
All files and directories in data/ are chmodded right, I think, so the only reason left I can imagine is that there is a problem with the safemode. As I looked into the source I noticed that the io_safeFile() function does not care about the safemodehack. Maybe you should add support for it there. Dunno.
P.S.: I reeeally like DokuWiki. It's so simple and although powerfull.
-
2005-10-29
Helios
Hello,
i try to run dokuwiki at a webhosted webspace, and now have a problem that is similar.
There is no problem with creating directories, but with .i and .xhtml files.
Writing /.../dokuwiki/data/cache/6/6a3605e56350bc408838ceaeb8cea315.i failed
Writing /.../dokuwiki/data/cache/6/6a3605e56350bc408838ceaeb8cea315.xhtml failed
I have tried safemodehack, but then dokuwiki has also problems with directories, so i unchecked it again.
What else can i try?
-
2005-12-03
Peep
It is not a wise idea to use the ftp hack as on some systems it is not possible (e.g. our Debian server has no FTP access allowed, just SSH and Samba). The solution is to create all the directories by the user, not Apache!
-
2006-05-18
oliversl
This seems to be the solution:
- If you use ftp + php safe_mode, follow this instructions:
http://wiki.splitbrain.org/wiki:safemodehack
- If you use only php safe_mode, all works fine. Don't the safemodehack
I have dokuwiki up and running in CentOS 4.3 using php safe_mode and base_opendir().
Be sure to config this in both cases:
$conf['basedir'] = '';
$conf['baseurl'] = '';
-
2006-10-20
gb
Can we close this now?
-
2006-10-20
gb
Issue said to be complete
-
Related tasks: