ребята помогите найти ошибку ( failed to open stream: Permission denied), хотя для папки стоит полный доступ, вообщем вот код, может кто найдет баг.
Warning: imagejpeg(C:/webserver/data/htdocs/site.com/www/_uploads/user_cover): failed to open stream: Permission denied in C:\webserver\data\htdocs\site.com\www\index.php on line 77
$upload_folder = $_SERVER['DOCUMENT_ROOT'] . "/_uploads/user_cover";
if(!file_exists($upload_folder)){
mkdir($upload_folder, 0777);
}
if($_FILES['cover']['type'] == "image/jpeg" || $_FILES['cover']['type'] == "image/png" || $_FILES['cover']['type'] == "image/gif"){
$filename = $_FILES['cover']['tmp_name'];
chmod($filename, 0755);
$percent = 0.5;
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent;
$new_height = $height * $percent;
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg($image_p, $upload_folder, 100);
}else{
echo "Format photo: gif, jpeg, png";
exit;
}