简体   繁体   English

move_uploaded_file无法在Windows服务器上运行

[英]move_uploaded_file does not working on windows server

I know this question is so common in stackoverflow and many questions are available on this topic, but still I did not match any answer solving my strange prblem. 我知道这个问题在stackoverflow中是如此常见,并且有很多关于这个主题的问题,但我仍然无法解决任何解决我的奇怪问题的答案。

$path = "img/"
$tmp = $_FILES ['footer-bg-img'] ['tmp_name'];
move_uploaded_file ( $tmp, $path . $actual_image_name );

its working fine on my local system both WAMP and XAMPP application, but on my windows web server it returns false , which makes me strange, on my web server I printed the function output, it gives me 它在我的本地系统上工作正常WAMPXAMPP应用程序,但在我的Windows Web服务器上它返回false ,这让我很奇怪,在我的Web服务器上我打印了函数输出,它给了我

string(27) "C:\\Windows\\Temp\\phpAA55.tmp" string(21) "/img/20131208_bjp.jpg" bool(false) dead string(27)“C:\\ Windows \\ Temp \\ phpAA55.tmp”string(21)“/ img/20131208_bjp.jpg”bool(false)dead

I have asked the service provider to give the img folder 0777 permission, they told me they have done that. 我已经要求服务提供商给img文件夹0777许可,他们告诉我他们已经这样做了。 But having still same problem, now should I contact the service provider or there could be coding error, please suggest. 但是仍然有同样的问题,现在我应该联系服务提供商或者可能存在编码错误,请建议。

I still think its a permissions issue. 我仍然认为它是权限问题。 Please have a look at the following topic: move_uploaded_file() returns false 请查看以下主题: move_uploaded_file()返回false

You can also check the permissions to the directory with PHP function: 您还可以使用PHP函数检查目录的权限:

if ( ! is_writeable ( $path ) )
{
    echo 'Can\'t write to directory, insufficient permissions.';
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM