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.
directory list without access permission
Moderator: General Moderators
- 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
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.
Re: directory list without access permission
Hi,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.
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.
- 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
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.