Loading...
 
Skip to main content

Architecture / Installation


Need help with permissions with Images and WYSIWYG

Ok. I've been banging my head on this issue the last few days without much result.

Every time I try to upload an image in the WYSIWYG editor using the tikiimage button I get a popup window. If I click "browse server". I get another popup window that reads, "Error creating folder, "/var/tikiwiki/tikiwiki-1.10beta/img/wiki_up/image"(mkdir()function.mkdir:Permission Denied"

I am using an Ubuntu server with php5 and mySQL. I have done a /sudo chmod -R 777 on the img folder and a /sudo chown -R www-data:www-data to the folder. I am able to upload images fine through the image upload feature in the "normal" editor with wiki syntax. Also, I have made sure the safemode is off in the php.ini file.

If I post the wiki syntax for an image in the wysiwyg editor like $img src="img/wiki_up/test.jpg"$ (changed '{' to '$') to avoid posting image here) and save, the image will appear. If I re-edit the wiki page and save again the image will break and inspecting the code will show that the path is wrong and that is now points to $img src=/tikiwiki/tikiwiki-1.10beta/lib/fckeditor/editor/%22img/wiki_up/test.jpg%22 height=24 width=24$

If there is any other solutions, including monkeying with the source, I am very open to try them. Thanks for any help.

Ok, I found a hack for my problem and I am now able to upload images.

In the file /var/www/tikiwiki/tikiwiki-1.10beta/lib/fckeditor/editor/filemanager/connectors/php
is a file called config.php. Near the beginning of this file is a line that reads

$tikiroot = dirnamedirname(dirname(dirname(dirname(dirname(FILE)))));
which I changed to
$tikiroot = dirname(dirnamedirname(dirname(dirname(dirname(dirname(FILE))))));

and then I had to change the line that reads
$Config'UserFilesPath' = $tikipath.'img/wiki_up/'.$tikidomain ;
to
$Config'UserFilesPath' = $tikipath.'tikiwiki-1.10beta/img/wiki_up/'.$tikidomain ;


In my installation I was nested one folder deeper then a regular installation so I had to hack a workaround to go deeper into the nesting. I know this is a hack and just a workaround, but it will work for me for now. Hope this helps somebody else in the future.