directory list without access permission

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
noanyx
Forum Newbie
Posts: 2
Joined: Thu Jul 08, 2010 8:09 am

directory list without access permission

Post by noanyx »

Hi,

I am new on php.

I need file and directory list for my application. My application runs at client-side. I wrote a php script to get directory list but it does not work unless read permission to anyone is enabled for the directory.But I cannot enable directory access because of security issues.

opnedir() , readdir(), scandir() and dir class. I tried all of them. I knew that php scripts run at server-side so it should not need anonymous directory access. Is this wrong?

Then I tried web service with soap. SoapServer and ServerClient. But it does not work too.

Can you help me? How can I get file and directory list from server to my client-side application?

Any help appreciated.
Thank you.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: directory list without access permission

Post by AbraCadaver »

If your script is running on a web server, then it runs as the web server user (apache, nobody, httpd, www-data, etc.) so it has the permissions of that user. So you can possibly put that user in a group that has read access to the directories.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
noanyx
Forum Newbie
Posts: 2
Joined: Thu Jul 08, 2010 8:09 am

Re: directory list without access permission

Post by noanyx »

AbraCadaver wrote:If your script is running on a web server, then it runs as the web server user (apache, nobody, httpd, www-data, etc.) so it has the permissions of that user. So you can possibly put that user in a group that has read access to the directories.
Hi,

Thank you very much AbraCadaver.

I simply upload my .php file to the server, I did nothing else. I don't know nothing else to do and I cannot find on the net. In this situation, is my script running on web server? If so how can I get as which user it runs? Can you give me a bit more detail information or a link that I can learn these?

Thank you again.
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: directory list without access permission

Post by AbraCadaver »

It depends on what type of server Linux, WIndows, etc. and what type of access you have to the server (probably need ssh).
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply