root folder?

Please post all install related problems here. Visit this forum first for troubleshooting.
Angus
Posts: 3
Joined: Sat 27. Mar 2004, 05:31

root folder?

Post by Angus »

Hello,

I uploaded the phpwcms to a directory like public_html/phpwcms/ (http://www.domain.com/phpwcms/ )

I notice that the index.php is located inisde this directory as well. Would that be possibile have the index.php in root directory? So the design is in http://www.domain.com ?

Or I must do this by upload phpwcms file to root directory in order to achive this?

Sorry, my English is not good.
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: root folder?

Post by DeXXus »

Angus wrote:Hello,

I uploaded the phpwcms to a directory like public_html/phpwcms/ (http://www.domain.com/phpwcms/ )

I notice that the index.php is located inisde this directory as well. Would that be possibile have the index.php in root directory? So the design is in http://www.domain.com ?

Or I must do this by upload phpwcms file to root directory in order to achive this?

Sorry, my English is not good.
Hello Angus!! Welcome :D

You CANNOT move ~just~ the "index.php" (or "phpwcms.php"), BUT, if you re-install with your domain's root directory as the destination for phpWCMS's root... then you will be alright (as long as you do not overwrite ~your~ important root files that may share the same name)

I hope my English makes sense to you :roll:
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

you can redirect via a javascript in a html file - not the best solution or you can use a .htaccess file and insert this to it - hope it works Im not so good at it:

Code: Select all

Redirect /index.html http://www.domain.com/phpwcms/
place it in your root
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
pSouper
Posts: 1552
Joined: Tue 11. Nov 2003, 15:45
Location: London
Contact:

Post by pSouper »

can you you could have your index.html in the root folder with a meta refresh or links t oindex.php. this is how a lot of sites including HTTP://www.phpwcms.de do it.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

or you could make a index.html file with this code:

Code: Select all

<script language="JavaScript">
self.location.href='phpwcms/index.php';
</script>
or this:

Code: Select all

<meta http-equiv="refresh" content="0;URL=phpwcms/index.php">
http://www.studmed.dk Portal for doctors and medical students in Denmark
Angus
Posts: 3
Joined: Sat 27. Mar 2004, 05:31

Post by Angus »

Thanks everyone. I am going to try it. :)
Jan212
Posts: 859
Joined: Wed 28. Jan 2004, 21:38
Location: Solingen
Contact:

Post by Jan212 »

point your domain with your apache and a virtual host entry to the root folder of phpwcms...
Regards/ Grüsse/ Groetjes - JAN212
------------------------------------------------
null212 - Büro für Kommunikation und Design
------------------------------------------------
Lyrikfetzen des Tages
1. Ist der Quelltext auch valide fragt Herr Müller ganz perfide.
2. Wat is dat een lekker ding.
3. Wer Vision hat soll zum Arzt gehen.
------------------------------------------------
gogoguerilla
Posts: 29
Joined: Mon 12. Apr 2004, 01:22

Re: Root Folder

Post by gogoguerilla »

I have a follow-up to the original question...

(I, too, am a newbie :? )

I understand that I can install the contents of the phpwcms foler into the root of my site; however, these are files I would call "private" - meaning that only site administrators/authors need or have access to them.

In order to keep my server clean (and organized), it would be nice if I could keep all the phpwcms files in a SEPARATE folder than the actual public files (which would be located in the root folder). When I need to login, I can just go to the subfolder. Editied/posted content would be published to the public files.

I hope this makes sense as this issue is the main thing keeping from getting going with the site.

Please let me know if you need clarification. THANKS!
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

If you want to have your phpwcms files where they are not accessible to your websever (ie below the document root) then you can simply make your root of phpwcms something like ".." and just keep index, login, and phpwcms.php files in your root folder. That is more or less how you would do it but I haven't tried it yet so your milage may vary.
gogoguerilla
Posts: 29
Joined: Mon 12. Apr 2004, 01:22

Post by gogoguerilla »

Right.. Thanks for the info; however, it didn't work. :(

This is what i get when I try and access http://www.mydomain.com/login.php.

Code: Select all

Warning: main(./include/inc_conf/conf.inc.php): failed to open stream: No such file or directory in /home/.galla/user/mydomain.com/login.php on line 26

Fatal error: main(): Failed opening required './include/inc_conf/conf.inc.php' (include_path='.:/usr/local/lib/php') in /home/.galla/user/mydomain.com/login.php on line 26
Do I need to make any other changes in the conf file (other than changing the root dir to "..")? Thanks.
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

I see the problem. I think you might have to keep the files in the same directory as your index, login, etc. I didn't think this was a problem but it appears it is b/c the includes do not check for the phpwcms root, only things like the file mananger and image functions do. I have a feeling this has to do with the fact that some users would need to have an absolute path (ie /home/www/user/www/phpwcms) for the includes to be filesystem agnostic. That could be a pain for some users who have hosts that are not very clear on how they have their servers setup.

I am sure there is a way to make the files more separated. You can do some server side configuration such as making the virtual domain point to your phpwcms directory or use some .htaccess magic to make things more secure but the easiest thing to do would be to just install it in your doc root (or where ever you need it) and let it be at that. I am not a server guru so others might have a better answer (deXXus is the man from what I have seen ;)). Sorry I don't have a better answer. Good Luck with it and if you have a more specific idea maybe someone or myself can be of more help.
gogoguerilla
Posts: 29
Joined: Mon 12. Apr 2004, 01:22

Post by gogoguerilla »

ion... so i decided to have a bit of fun with BBedit and simply changed all the file references inside the index, phpwcms and login files to point to the appropriate directory. Set, yeah? Not quite.. none of the images were working, so I had to change the "img" tags in the "inc_tmpl" directory.. so far it's all working...

However, I wonder if I would have to change all references to the "include" directory in all the files to be relative to the domain root folder where the actual site content will be (vs. the phpwcms folder). Any thouhgts?

Thanks for giving me the inital idea - I hope this will work. (knock on wood.)

By the way, your (personal) site is fantastic... very graceful - haven't checked the other, yet.
Sad update.... It didn't work (you probably could have guessed)... But I'm still convinced that there's a way to do this.

Here is my idea: Is there a way possibly to change the way the files are published so that they publish to a different directory than the one that the phpwcms folder is installed in?

:?:
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

What you could do is make a variable in conf files array for your doc root for your files that will be accessed through php (ie the includes) and then leave the images and other similar items along such as the file manager stuff since any web browser is going to need to be able to get to that. Once you make the php root (ie /home/www/myusername/ or something) you can just add that to the includes like

include_once $_PHPWCMS['php_doc_root']."./WhateverOliverhashere.file";

That will make things better in the long run. But I think you have the idea even though it kind of sucks to go through everything like that. Hope it works for you though. I would be thinking though you should be able to do things in a way so when there are upgrades you can make them less painful than going through every file changing the doc root kind of stuff ;) Good Luck
gogoguerilla
Posts: 29
Joined: Mon 12. Apr 2004, 01:22

Post by gogoguerilla »

Oh dear... I don't follow at all - this is prob frustrating for you.

At this point, I think I'm probably best going with a clean install (seeing as I haven't really created any templates worth keeping at this point).

I think I will use the suggestion you made in another thread - to place all the files in a directory outside (below) the root (public) directory but I'm still not clear how exatly that would work in regards to loggin in, etc. (I sent you a PM regarding doing that.)

However, I still would like to at least be able to understand what you are suggesting here (because I'm a dork like that).

Regarding this string:

Code: Select all

include_once $_PHPWCMS['php_doc_root']."./WhateverOliverhashere.file"; 
Where is being placed? - in conf.inc.php? What is "./whateverOliverhashere.file"?

Again, thanks for your help (and patience). I want to be able to get this working but I'm excited about learning the new stuff as well.
ionrock
Posts: 279
Joined: Fri 20. Feb 2004, 17:04

Post by ionrock »

Well, when you look in your conf file you will notice that it is just on big array. So you would just create a new entry in the array. This may sound tough but when you look at it, things will be really easy. For example this is the entry for the doc root in relation to the site (for things like images and links)

Code: Select all

// this is your website
$phpwcms["site"]              = "http://ionrock.org/";

// this is where phpwcms is installed
$phpwcms["root"]                        = ""; 
So, the way you would echo a link to an image in your phpwcms root, for example would be as follows:

Code: Select all

echo "<a href=\"".$phpwcms['site'].$phpwcms['root']."myimage.jpg\">link text</a>
Now that works b/c the browser is calling that file so it is the server that will give the browser the file. But the difference when you do something like an include or include_once in php is that it is php getting file for itself so the whole http://domain.org stuff doesn't make sense. Of course php can still include a foreign file but if you wanted to include a file on the server then would be going about it the wrong way.

The reason for this is pretty simple. If you browse to a page in your browser coming off a server it has been parsed by the server. The server has already interpreted whatever code that was written and all you get is plain text/html. But when php goes and gets a file from the file system it sees it as unparsed and trys to do things with it like read variables and functions. This makes it possible for php to get files from any where on the server when the web server will only get files from specific places.

With regard to making to different roots, what I mean is making a root for the server and one for php.

Code: Select all

$phpwcms['php_root'] = "/home/user/";
$phpwcms['root'] = "";
This may not make a lot of sense... but at the same time it does. When php wants to include a file it does something like this

Code: Select all

include $phpwcms['php_root'] . "./include/myfile.php";
// includes the file "/home/user/include/myfile.php"
By doing this then it is below the doc root of the site so it is not accessible by a browser but it is still accessible by php. For an image though something like this would be done

Code: Select all

echo "<img src=\"" . $phpwcms['site'] . $phpwcms['root'] . "/images/myimage.jpg" />";
// the image source is http://mydomain.org/images/myimage.jpg
// there is nothing after the mydomain.org b/c there is nothing 
// at the $phpwcms['root']
If you installed phpwcms in a folder called cms for example, $phpwcms['root'] would be "cms" so the url above would change to http://mydomain.org/cms/images/myimage.jpg

That is pretty much it! That was a pretty long post so I am going to bed! Good luck and always remeber php.net is the best documentation you can find so learn to read it and you will be a php guru in no time ;)
Post Reply