PHP is_dir and mkdir not working on mapped network drive

蓝咒 提交于 2019-12-08 07:48:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!