Jump to content

imagejpeg() Unable to open [file] for writing in index.php


michaellunsford

Recommended Posts

this is weird, this php script worked great on my old server, but the new one reports "unable to open file" but conspicuously absent is the "permission denied" part. I've verified the path four times and made sure the directory has 777 permissions, I've even recursively set the 777 permissions about six times and verified via "ls -l" that they're wide open. I also temporarily turned off PHP safe mode and ran it a few more times without success. Finally, I provided "NULL" in imagejpeg()'s filename field and it dumped out the image (so we know there's one in there).

 

I'm just stumped. Any other ideas?

 

<?php //paths simplified for example
$myrow['PHOTO1']="some_random_photo.jpg";
$im=imagecreatefromstring(file_get_contents("/".$myrow['PHOTO1']));
imagejpeg($im,"/thumbs/".$myrow['PHOTO1'],80);
?>

  • 5 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.