this is error getting from upload images, the images cant move and permission denied, I have also configured the directory but still same. anyone has an idea please help
Warning: move_uploaded_file(img/t-shirts-1.jpg): failed to open stream: Warning:Permission denied in /var/www/html/wp_inventori/edit.php on line 25 move_uploaded_file(): Unable to move '/tmp/phpUIcxe5' to 'img/t-shirts-1.jpg' in /var/www/html/wp_inventori/edit.php on line 25
if(isset($_FILES['imagen']['name']) && ($_FILES['imagen']['name']!="")){
$target_dir = "img/";
$file = $_FILES['imagen']['name'];
$path = pathinfo($file);
$filename = $path['filename'];
$ext = $path['extension'];
$temp_name = $_FILES['imagen']['tmp_name'];
$path_filename_ext = $target_dir.$filename.".".$ext;
if (file_exists($path_filename_ext)) {
echo "Sorry, file already exists.";
}else{
move_uploaded_file($temp_name,$path_filename_ext);
echo "Congratulations! File Uploaded Successfully.";
}