Complete newbie WAMP server question

I am trying to get a gallery working…the problem is I am very new at this PHP thing. I have all my files directly under ‘www’ which is the root folder I think for WAMP. Thye instructions I was given for the gallery are this…

  • The two following settings point the script to the folder that
  • contains your galleries.
  • DOC_ROOT is the full physical path to your website’s
  • document root. For most users, $_SERVER[‘DOCUMENT_ROOT’]
  • will work here.

define(‘DOC_ROOT’, $_SERVER[‘DOCUMENT_ROOT’]);

  • GALLERY_ROOT is the path, relative to your document root,
  • under which all your galleries reside

define(‘GALLERY_ROOT’, ‘/images/pic’);

My question is in brackets […] for document root , should I write ‘www’? or C:/www ?

And for gallery_root should I write the same since it is all directly under ‘www’ folder??

Thank you for your help… :slight_smile:

var_dump($_SERVER['DOCUMENT_ROOT']);

Try that, hopefully answers your question?

If your project files are directly under www folder then you don’t have to do anything. $_SERVER[‘DOCUMENT_ROOT’] will return the document root of web server (in it is defined apache httpd.conf). You need to put the rest of the page from the root to point your image folder i.e. if your project name is ‘myproject’ under ‘www’ document root then your second line should look like this:


define('GALLERY_ROOT', '/myproject/images/pic');

Hash… I think I am a newborn in php. I need help from A,B,C… your post is very advanced for me. I will try and explain as much as I can… I have a file called config.php and the following two php statements … are where I am supposed to point my website to the server as I understand… But I do not know how to do that. Since I have all my pictures and in ‘www’ folder what should I do to point my gallery to the server?? should change anything in the following since I have all my pics in my wamp server’s www folder?

define(‘DOC_ROOT’, $_SERVER[‘DOCUMENT_ROOT’]);

The next one is

define(‘GALLERY_ROOT’, ‘/images/pic’);

Should I change anything in the second statement?? I am really new … at this sorry if I am asking dumb questions… :slight_smile:

It’s not about php, if you tried what I posted you would see that it prints a path like c://wamp/public_html or something.

If this path is not correct, you need to replace $_SERVER[‘DOCUMENT_ROOT’] with a string that is, eg ‘c://wamp/public_html/mysite’

For the second one, you need a string that, when combined with the first, is a real directory, eg ‘c://wamp/public_html/mysite’ combined with ‘/path/to/gallery/’ gives ‘c://wamp/public_html/mysite/path/to/gallery/’, which you should be able to visit on your pc.

$_SERVER[‘DOCUMENT_ROOT’] will never give incorrect value if web server is configured correctly but off course that it is needed to append the foldername if it is running more than one projects in ‘www’ folder (in case of WAMP here) if it is needed.


define('DOC_ROOT', $_SERVER['DOCUMENT_ROOT'] . '/mysite');

Now the document root means the project root.

But rajeev, you don’t have to change this line but if you are really sure that all the images directly stored in www folder then simply put $_SERVER[‘DOCUMENT_ROOT’] in your second line as follows:


define('GALLERY_ROOT', $_SERVER['DOCUMENT_ROOT']);

  • GALLERY_ROOT is the path, relative to your document root,

.

Ahh… yes but still it wont make any difference if OP is sure about the path for the images until GALLERY_ROOT is not needed for HTTP. So to be safe do the following then:


define('GALLERY_ROOT', '/');

Edit:
The above is if the images really are stored directly in the root. But I would suggest not to keep the images directly in the document root rather create a folder and put all the images there. Like if you create a folder named ‘mypics’ then set the GALLERY_ROOT as follows:


define('GALLERY_ROOT', '/mypics');

Off Topic:

what does this mean in your avatar thingy
“So called - Joomla Lead”
You are the Joomla Lead? You want to be? You think you are? You are thought of as?

Well actually I am compelled (compelled because I am not that much expert in Joomla still learning that’s why I called myself ‘so called’) to lead some Joomla related projects in my company so I put it there. I was supposed to put ‘Leader’ actually but that word is reserved by vbulletine so it just cut ‘er’ off and showed only ‘Lead’.

BTW hash, do you have any problem putting that there? Do you think that I don’t deserve to put that in my ‘Custom Title’?? Why thingy?
Edit:
Or is it against the norms in this forum?

Thank you guys… I will work on this from your tips… :slight_smile: