File upload fputs未在服务器上写入映像

File upload fputs未在服务器上写入映像,file-upload,nginx,php,File Upload,Nginx,Php,FPUT和文件内容不工作。 我用move_upload_file创建了一个php上传文件示例,它在同一个上传文件夹中工作 $data = file_get_contents($url); $image = config_item('temp_upload').$image_name; $file = fopen($image, 'w+'); //fputs($file, $data); file_put_contents($file, $data, FILE_BINARY); fclose($f

FPUT和文件内容不工作。 我用move_upload_file创建了一个php上传文件示例,它在同一个上传文件夹中工作

$data = file_get_contents($url);
$image = config_item('temp_upload').$image_name;
$file = fopen($image, 'w+');
//fputs($file, $data);
file_put_contents($file, $data, FILE_BINARY);
fclose($file);
我试图将上传文件夹更改为0777 nginx:nginx(nginx)apache:apache(php-fpm),但没有任何效果。相同的零字节图像

禁用selinux。还是没用。我在这方面有任何错误


替换了“移动”“上载”“文件”“放置”“内容”相同的问题。php.ini中有什么需要更改的吗?已搜索,但未获得任何线索。

AFAIK file\u put\u contents函数的第一个参数需要直接是路径/文件名。您不需要fopen和fclose函数

fopen($image,'w+') actually create the image with 0 byte.