PHP is_file returns false (incorrectly) for Windows share on Ubuntu

雨燕双飞 提交于 2019-12-13 02:57:54

问题


Ubuntu server, PHP 5.3, connected via Samba to Windows server share.

I am using file_exists() to check for availability of file on Windows machine. It returns false, although the filepath does exist. Meanwhile, file_get_contents() on the exact same filepath works fine.

I'm wondering if it's a permission issue, since I'm having trouble configuring permissions of the files on the Windows share (it says I don't have permission to change permissions on them). When I look at the permissions through Nautilus, it says the user and group are both root, with 755 rights. I'd like to change the group to www-data, but can't seem to do it.


回答1:


It could be directory seperators. Try preg_replace('%(\\|\)%', '/', $path)



来源:https://stackoverflow.com/questions/2504926/php-is-file-returns-false-incorrectly-for-windows-share-on-ubuntu

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