php - copy() function returns "permission denied" -


the code below used work fine, since upgrading system (from mandriva 2010 & kde 4 fedora 23 & kde 5.14) lot of things have broken, including this. i've managed fix of other problems, specific issue still eluding me.

i suspect code isn't problem, i'll post here have elements:

$infile = stripslashes($infile); $filepath = "../site/images/thumbs/$dlettr/"; $outfile = $filepath . $id . '-ori.' . $fext; copy($infile, $outfile); $gis = getimagesize($outfile); $width = $gis[0]; $height = $gis[1]; $outfile2 = str_replace("-ori.$fext", '-0.jpg', $outfile); $im = new imagick("$outfile"); $im->setimageformat("jpg"); $im->writeimage("$outfile2"); unlink($outfile); 

the original $infile url of image passed through form. $dlettr letter determined earlier in code. $fext file extension, determined earlier. $id numerical associated page code running on, , unique identifier file.

what code download image given url, save in appropriate path, , associate current page being processed from.

since upgrading, following when try run code, regardless of url:

warning: copy(../site/images/thumbs/g/27879-ori.jpg): failed open stream: permission denied in /var/www/html/site/index.php on line 1055

warning: getimagesize(../site/images/thumbs/g/27879-ori.jpg): failed open stream: no such file or directory in /var/www/html/site/index.php on line 1057

fatal error: uncaught exception 'imagickexception' message 'unable open image `../site/images/thumbs/g/27879-ori.jpg': no such file or directory @ error/blob.c/openblob/2701' in /var/www/html/site/index.php:1064 stack trace: #0 /var/www/html/site/index.php(1064): imagick->__construct('../site/images...') #1 {main} thrown in /var/www/html/site/index.php on line 1064

yes, imagemagick plugin installed ;-)

at first thought might selinux issue, many of other problems have been linked that, i'm not seeing errors in audit log, that's not it.

so thought of permissions issue, because of "permission denied", tweaked death no avail. set 777 both folders , files, , still won't save picture!

as ownership, files , folders owned user:user, apache being member of user's group (so should able access folders , save image within).

one little detail should specify, think might heart of problem (though worked fine in previous system) have limited space on /var partition, , since expect image library grow quite bit, storing pictures in different, larger partition, , symlinked folder /var/www/html/site:

$ ls -l /var/www/html/site/ lrwxrwxrwx. 1 user user     17 oct  9 04:51 images -> /mnt/site/images 

i tried google errors get, i'm seeing problems resolved chmod, not doing here... likewise, there few similar questions on stackoverflow, none match exact situation.

side note: apache user named 'apache', , there apparently no php user in fedora 23 (the service started along apache, guess apache php user...)


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -