Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KodaC's avatar
Level 1

Laravel and IIS: could not be opened in append mode

I have Laravel installed on a Windows server with IIS and PHP 8.2. Now I get the following error

"The stream or file "C:\inetpub\wwwroot\laravel\storage\logs/laravel-2023-02-23.log" could not be opened in append mode: failed to open stream: Permission denied"

I have found many posts and have implemented all the tips.

  • Modify Permission for IUSR on the storage folder
  • Full Access for IUSR for bootstrap/cache folder

I also checked that fastcgi.impersonate = 1 is set in my php.ini.

Does anyone else have an idea what I might have missed?

0 likes
1 reply
LaryAI's avatar
Level 58

It sounds like you have already done the necessary steps to ensure that IIS has the correct permissions to write to the log file.

One thing you could try is to set the APP_LOG_LEVEL environment variable to debug in your .env file. This will allow you to see more detailed information about the error in the log file.

You could also try running the following command in the command line to ensure that the log file has the correct permissions:

chmod -R 777 storage/logs

This will give full read, write, and execute permissions to the log file.

If none of these solutions work, you could try setting up a virtual host in IIS and setting the APP_LOG_CHANNEL environment variable to errorlog in your .env file. This will allow IIS to write the log file to the IIS log directory.

Please or to participate in this conversation.