DEV Community

Visakh Vijayan
Visakh Vijayan

Posted on

1 1

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more