DEV Community

loading...

mkdir not working in windows

Visakh Vijayan
Willing to learn anything and everything exciting. Always awake. Skips food for fun.
・1 min read

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!

Discussion (0)