Page 1 of 1

directory list without access permission

Posted: Thu Jul 08, 2010 8:18 am
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.

Re: directory list without access permission

Posted: Thu Jul 08, 2010 10:44 am
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.

Re: directory list without access permission

Posted: Sat Jul 10, 2010 3:21 am
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.

Re: directory list without access permission

Posted: Sat Jul 10, 2010 9:51 am
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).