I can't figure out why I'm receiving this error when trying to save an image using imagejpeg()
Below is an excerpt from my code where I've eliminated anything extraneous and kept enough to generate the error. The path definitely exists and it has permissions set to 777.
$url = "http://website.com";
$filename = 'imagename';
$filepath = $url."/Images/accents/generated/".$filename.".jpg";
$base = imagecreatefromjpeg($url.'/images/'.$filename);
$imagewidth = imagesx($base);
$imageheight = imagesy($base);
$new = imagecreatetruecolor($imagewidth, $imageheight);
imagecopy($new, $base, 0, 0, 0, 0, $imagewidth, $imageheight);
imagejpeg($new, $filepath);
imagedestroy($new);
`