问题
I have mapped my Z: drive to point to a file share on another server on my network in Windows Explorer. I can access the files and read/write just fine there.
When I try to execute mkdir() from PHP, I get a "No such file or directory" error.
As a test, I gave Everyone access to read, write, and execute and it is still not working.
The code I am using:
mkdir('Y:/newfolder/', 0777);
I have also tried mapping the drive again within PHP to no avail:
system('net use Y: "\\DEV01\share" Password1 /user:Administrator /persistent:no>nul 2>&1");
mkdir('Y:/newfolder/', 0777);
Please assist.
回答1:
Thanks for your advice everyone. It turned out to be a syntax error. In the mapping code. You must map the drive manually within the PHP script like I did above, except you have to escape your backslashes in there. Instead of
\\DEV01\share
, you must use \\\\DEV01\\share
.
来源:https://stackoverflow.com/questions/11872803/php-is-dir-and-mkdir-not-working-on-mapped-network-drive