How to fix the PhpStorm error, “The IDE cannot create the directory”, in under a minute

PHPStorm modal error showing the message, "The IDE cannot create the directory"

On a couple of occasions, I’ve encountered a very annoying issue where PhpStorm will not open. Instead of opening it throws up the error message, “the IDE cannot create the directory.”, in a modal window.

I’m using JetBrains’ Toolbox to manage their IDEs and on the whole it’s a great little app to navigate their many IDEs and reopen an existing project. But, like a lot of software that we come to rely on, it’s a complete pain in the arse when it, seemingly out of the blue, stops working.

Why is PhpStorm not loading from the JetBrains Toolbox app?

The error message states that the problem may stem from incorrect permissions or the parent directory being read-only  – the full message is:

The IDE cannot create the directory.
Possible reason: parent directory is read-only or the user lacks the necessary permissions.

If you have modified the ‘idea.log.path’ property, please make sure it is correct, otherwise, please re-install the IDE.

Location: /Users/<username>/Library/Logs/JetBrains/PhpStorm2031.3
java.nio.file.AccessDeniedExpection: /Users/<username>/Library/Logs/JetBrains/PhpStorm2031.3

How to fix “the IDE cannot create the directory”

After trying many suggestions on the Web, including reinstalling PhpStorm, I found that the really simple process of removing the log files completely resolved the problem. This works because it forces the initialisation process to recreate them, and, in doing so, it creates them with the correct permissions.

Remove log files using the command line

The easiest way to remove these files is using the following command, which will recursively remove the “Log” folder and all it’s content:

$ rm -rf ~/Library/Logs/JetBrains

Removing log files using Finder

If you’re not comfortable with the CLI then you can always use the Finder app to remove them by taking the following steps:

  1. Choose “Go” from Finder’s menu options
  2. Enter the location from the error message, or the following, replacing <username> with your account:
  3. Delete the JetBrains folder

This solution didn’t work for you?

After a lot of research that all fell short of a solution, the process above of removing the log files, fixed the problem for me, on more than one occasion. However, it may be that, even though you’re getting the same error, your problem may not be the same as mine? So if this solution doesn’t work for you I’d strongly recommend you contact JetBrains technical support, or you carry out some more research and try some of the other fixes that have helped others.