access linux root 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
shawnzhou888
Forum Newbie
Posts: 6
Joined: Wed Jun 04, 2003 2:29 pm

access linux root directory

Post by shawnzhou888 »

I tried to access the files in the linux root directory but failed. Does the Apache server must to run as root for enabling that?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

depends on the file permissions.
what do you mean with access?
a directory listing or reading file-contents?
shawnzhou888
Forum Newbie
Posts: 6
Joined: Wed Jun 04, 2003 2:29 pm

Post by shawnzhou888 »

I set a simple file readable for all. Like: chmod +r a.ini . It's under /root. But from PHP the file cannot be opened.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Try checking phpinfo() regarding the "safe mode" settings? (long shot, I know)
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

it is a big difference of "the root directory" / and the directory /root

/ is accessible by anyone

/root is in most cases (default distro setups) not accssible by by anyone else than root
shawnzhou888
Forum Newbie
Posts: 6
Joined: Wed Jun 04, 2003 2:29 pm

Post by shawnzhou888 »

Its Safe mode is off. Sounds like the only solution is to run apache as root.
Post Reply