0

On my site, I am getting this warning.

Alert: User warning: mkdir(): Permission Denied in Drupal\Component\PhpStorage\FileStorage->createDirectory() (line 123 of core/lib/Drupal/Component/PhpStorage/FileStorage.php).

I want to debug or get the exact path and directory where Drupal is trying to create the directory.

I tried changing the file permissions for sites/default/files with chmod -R 777 path, without success.

How can I debug it?

1
  • I’m voting to close this question because debugging is not possible. Commented May 4, 2022 at 7:34

1 Answer 1

1

The standard debugger for PHP is Xdebug. Install it and set a breakpoint at that line. If for some reason you cannot use Xdebug, \Drupal::logger('my_module')->notice($message) or error_log() the filename to be written and examine the logs.

5
  • My Problem is at server. I can't debug at server. Commented Apr 29, 2022 at 11:38
  • Error showing in core files i can't update core file. Commented Apr 29, 2022 at 17:19
  • 3
    @KamalOberoi If you can’t use a debugger and you can’t edit the files, how do you expect to debug the site?
    – Clive
    Commented Apr 29, 2022 at 17:41
  • @Clive I want to use debugger but error is showing at core files. I don't want to put drupal logger in core files. If i know error is coming from my custom module or any contrib module then i can put try / catch and logger. Commented May 2, 2022 at 4:54
  • I vote to close this question as unanswerable. I provided a correct answer detailing how to debug in Drupal but the constraint is that no debugging is possible.
    – mona lisa
    Commented May 2, 2022 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.