mkdir: No such file or directory — Windows, OneDrive

  mkdir, onedrive, php, windows

Like the name says, mkdir is failing with a warning of "No such file or directory" on one of our VMs. I am trying to create a folder in a synced OneDrive folder. I know it’s possible because it runs perfectly fine on my machine. I cannot for the life of me figure out why it won’t work on the vm, though.

The path is 100% legit. I’m able to copy-paste it into file explorer and it will open right to it. I have permissions on the folder, it’s running in the command line so nothing to do with Apache or any web server restrictions, and I’m passing in the recursive flag.

What am I missing?

$path = path_base();
if ( !is_dir( $path ) ) { mkdir( $path, 777, True ); }

Source: Ask PHP

LEAVE A COMMENT