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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs