DEV Community

Visakh Vijayan
Visakh Vijayan

Posted on

mkdir not working in windows

I have been having a tough time with mkdir() to get it to function in windows using CakePHP.

This doesn't work properly in windows

mkdir($this -> webroot . "uploads/abc");
Enter fullscreen mode Exit fullscreen mode

Use this instead

mkdir(getCwd() . "/uploads/abc");
Enter fullscreen mode Exit fullscreen mode

Wasted a hell of a time on this. Hope someone else doesn't.

Back to work!

Top comments (0)