Page 1 of 1

reference an ubuntu directory

Posted: Wed Mar 25, 2009 5:39 am
by funkyapache
Hi

I did a the normal LAMPP installation on my ubuntu machine. I know my installation is stored under /opt/lampp and my webpages are under /opt/lampp/htdocs.

My question is how do I point to another directory in PHP. I want to point to /opt/lampp/web_site_copy/pictures

Do i need to make changes to my apache config file and if so how do i do it?

I looked throught my phpinfo() and doc_root is not specifed and neither is user_doc.

I am new at using php so please bear with me and thanks for the support its really appreciated.

Code: Select all

<?php
$dir    = '/tmp';
$files1 = scandir($dir);
$files2 = scandir($dir, 1);
 
print_r($files1);
print_r($files2);
?>
When I run this code it does return some values but I'm not sure where there "tmp" directory is.

Re: reference an ubuntu directory

Posted: Thu Mar 26, 2009 1:02 am
by sujithtomy
Hello,

Option 1:
set doc root in apache config file
DocumentRoot "/opt/lampp/web_site_copy/pictures"

Option 2:
set doc root in php.ini file
doc_root = "/opt/lampp/web_site_copy/pictures"

Option 3:
use virtual host.
Documentation can found here http://httpd.apache.org/docs/1.3/vhosts/

Re: reference an ubuntu directory

Posted: Thu Mar 26, 2009 4:50 am
by funkyapache
Thanks I will give that a try.