[Pmwiki-users] Bizzare mkdir problem, and solution

Donald Gordon don
Wed Apr 28 06:16:21 CDT 2004


Hi

Running pmwiki on a virtual host, we had some trouble with creating the 
upload/Group/ directories: when you uploaded an attachment into a group 
for the first time, you'd see a "cannot access upload/Group/" error, 
and PmWiki would tell you the standard story about MkDir - and you'd 
have to FTP in and create the directory yourself.

I don't know if it's the version of php, something to do with safe 
mode, or something else, but omitting the trailing slash on the 
directory name passed to mkdir() seems to make things work.  
Unfortunately this requires a change to pmwiki.php, so we can't do it 
as a local customisation:

   function mkgiddir($dir) {
     global $ForceMkdir;
+   $dir = preg_replace("/\\/$/", "", $dir);
     if (is_dir($dir)) return;

Alternatively, passing a directory name to mkgiddir() from upload.php 
without a trailing slash will also work.

donald




More information about the pmwiki-users mailing list