Support

Akeeba Backup for Joomla!

#35088 Cannot list contents of directory

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by on Wednesday, 19 May 2021 20:17 CDT

alexm

I am using Windows Server with IIS. Using Application Pool for Authentication and I added the IIS AppPool to my root folder with Full Permissions and still I get:

 

[210416 09:16:27] Cannot list contents of directory <root> -- PHP's DirectoryIterator reports the path cannot be opened.
[210416 09:16:27] Unreadable directory <root>
[210416 09:16:27] Cannot list contents of directory <root> -- PHP's DirectoryIterator reports the path cannot be opened.

nicholas
Akeeba Staff
Manager

I'm afraid this is still a permissions issue. Akeeba Backup simply uses PHP's DirectoryIterator to open the folder for enumerating (listing) its contents. PHP asks the Operating System to do that. When the Operating System says PHP is not allowed to open the folder for listing its contents PHP throws an Exception (a kind of catchable error condition). This is what we catch and report back to you. In other words, there is nothing our code or even PHP itself can do.

Note that last year I had written a blog post about setting up an IIS installation for local development (https://www.dionysopoulos.me/iis-development-server-for-php-on-windows-10.html). While writing it I had noticed a few things:

  • It is important to give the correct permissions to the folder of the site for the specific Application Pool user, not the IIS primitive users. You need to give Read & Execute, Read and List Folder Contents for directory iteration to work. The first two privileges would allow a Joomla or WordPress site to run since you are always accessing a specific file (index.php) but not iterate it. Unlike *NIX systems like Linux where the execute privilege allows you to iterate the contents of a directory, Windows has a specific privilege.
  • You need to make sure that any symlinked files/folders or directory junction targets have the same privileges. The privileges are evaluated at the leaf node of the filesystem, not the symlink or junction point.
  • Make sure the site is assigned to the same Application Pool.
  • Make sure PHP runs as FastCGI. I don't think you can run it in any other way on IIS but it's good to make sure anyway.
  • After making all changes you need to restart the site in the IIS management console. Otherwise the site is still running under its default Application Pool and you get all the wrong permissions.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!