reference an ubuntu directory

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
funkyapache
Forum Newbie
Posts: 11
Joined: Tue Mar 24, 2009 11:19 am

reference an ubuntu directory

Post 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.
sujithtomy
Forum Commoner
Posts: 46
Joined: Tue Mar 24, 2009 4:43 am

Re: reference an ubuntu directory

Post 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/
funkyapache
Forum Newbie
Posts: 11
Joined: Tue Mar 24, 2009 11:19 am

Re: reference an ubuntu directory

Post by funkyapache »

Thanks I will give that a try.
Post Reply