dougaimian1143 2017-07-27 19:52
浏览 80

PHP:如何将文件从IBM(Unix)文件系统传输到Windows网络共享?

We have a Windows network share of say \\share\drive, but if I try to save to that in PHP it just tells me directory not found (though it works from my Windows box).

Our IBM guy says it should work but it doesn't... I've tried various combinations and I have no examples in our PHP code of anything doing this (to any share).

$share = '\\\\share\\drive'; // or '//share/drive'
file_put_contents($share, 'blah');

IBM docs say it'll just work as UNC... but it doesn't... so at this point I'm not sure what to do.

  • 写回答

1条回答 默认 最新

  • dongyiba8082 2017-07-27 21:26
    关注

    Did you mount your winDoze network share on the 'nix file system? Just because winDoze is sharing the directory doesn't mean anybody else knows it's there - you still have to mount the directory for your PHP code to be able to see it.

    BTW, this isn't a programming question, so it really doesn't belong here, you should be asking on ServerFault.


    EDIT

    Try this: Open a shell prompt on your IBM system, and run this command:

    find / -name "<drive>"
    

    where <drive> is the share name of the Windows network share. If find finds a location for your network share, you will have the path to use in its output.

    If find returns an empty result set, run mount at the shell prompt. You will get an output that looks something like this:

    /dev/vzfs on / type reiserfs (rw,usrquota,grpquota)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,relatime)
    none on /dev type tmpfs (rw,relatime)
    none on /dev/pts type devpts (rw,relatime)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
    

    Chances are extremely high that you won't find your network share <drive> in this list, either. That means you need to mount the network share as a resource on your Unix system. There should be an empty directory (usually /mnt) that you can mount the network share on, read the mount man page for instructions.

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?