Page 1 of 1

>> problems with paths in file manager

Posted: Fri 21. Nov 2003, 22:03
by svobi
hello

i've encountered difficulties with the file manager.

it seems to me, that there is some chaos with the paths used for this.

i have the following setup:

apache with mod-rewrite rules, that mimicks subdomains.

/home/domain/public is the webroot, here are no files

/home/domain/public/www is the subdomain http://www.domain.com
/home/domain/public/sub would be sub.domain.com

when someone tries to open domain.com there get redirected to http://www.domain.com

ok now to the problems:

first the setup script:
it showed me as path "/home/domain/public" so i added
$phpwcms["root"] = "www";
because my phpwcms is in this directory.

i was not able to login with this setup, so i changed it back to
$phpwcms["root"] = "";

so ok login was possible and i tried to upload some files.

"Error while creating user directory. Please do not try again - this is an server error! Contact the webmaster to tell as soon as possible!"

ok i searched and find out that i need to set the config vars so:

$phpwcms["file_path"] = "www/phpwcms_filestorage";

ok now fileuploads seems to run nicely, also check out to insert some image in an article.

the image browser showed me nothing, absolutely nothing.

also i checked again and saw, that i had no thumb or preview, also changed the config once again:

$phpwcms["file_tmp"] = "www/phpwcms_tmp";

and created the dirs "thumb_list" & "thumb_preview" in there.
(update) i created this dirs in this place, because the setup script was only happy with this setup

now after image upload the file manager tried to show me a picture, and in the above created dirs, i found a thumb and a preview.

so i wondered why the file manager or the image_browser can't display it.
after checking the paths in the <img src= in the file manager preview, i saw that he is trying to get the picture with this URL:

http://www.domain.com/www/phpwcms_tmp/t ... lename.ext

when you compare this URL with my setup described @ begining of this post, you see that it should look like so:

http://www.domain.com/phpwcms_tmp/thumb ... lename.ext

it seems to me like i need 2 different config vars for this /thumb_list/ path.
a real filesystem path & a virtual HTTP path.

what does the author of this nice phpwcms means to this problem ?

ps: i don't want to fix it myself in the code, i would like to see it fixed in the app. if needed i could help a little bit with coding.

Posted: Fri 21. Nov 2003, 23:59
by Oliver Georgi
Hm,
why do you not link the http://www.domain.com also to "/home/domain/public". I have never seen such configuration. Normally http://www.domain.com and domain.com links to the same space.

But if you can not change this why do you not link the http://www.domain.com to domain.com. Install phpwcms in domain.com.

Oliver

Posted: Sat 22. Nov 2003, 00:05
by rudeboy
such an apache configuration ist often used for dynamic subdomains. this means you can simply add a new directory under public folder and surf on directoryname.example.com ;). i use such a configuration tooo and i am experiencing the same troubles :(, once if i have some minutes i will look up how to make it independent where the wcms is located.

Posted: Sat 22. Nov 2003, 00:20
by Oliver Georgi
a simpe workaround is a change of default.inc.php:
set $_SERVER["DOCUMENT_ROOT"] to your "real" root dir.

Posted: Sat 22. Nov 2003, 00:32
by svobi
would it not be better to change the
$_SERVER["DOCUMENT_ROOT"]
in general to
dirname($_SERVER['SCRIPT_FILENAME'])
?

the whole phpwcms runs either via index.php or phpwcms.php, so the users would have one $var less to configure.

greets & thanks for your tip, will going to try this.

(update)
it works so far i can see.
i changed it to
dirname($_SERVER['SCRIPT_FILENAME'])

Posted: Sat 22. Nov 2003, 09:49
by Oliver Georgi
This makes problems in every act_script. It's no "really" constant like "DOCUMENT_ROOT"
It is simpler to hardcode the path. I will change that in one of the next releases.

Oliver

Posted: Sat 22. Nov 2003, 16:33
by svobi
hmmm, are the act_scripts called separately ? or via includes in index.php or phpwcms.php ?

when all scripts are called with includes in one of the 2 main-files,
dirname($_SERVER['SCRIPT_FILENAME'])
would always report the dir, where this main-files are stored.

or not ?

Posted: Sat 22. Nov 2003, 16:46
by Oliver Georgi
No - all act files are NO included files.