$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);
fputs and file_put_contents are not working. I created a sample php upload file with move_uploaded_file, and it works on the same uploading folder.
fopen($image,'w+') actually create the image with 0 byte.
I tried to change upload folder to 0777 nginx:nginx(nginx) apache:apache (php-fpm) nothing works. Same zero byte image.
Disable selinux. Still no use. I am getting any error for this.
Replaced move_uploaded_file to file_put_contents same problem. Is there anything to change in the php.ini? Searched and did not get any clue.