Corinne Posted February 10, 2010 Report Share Posted February 10, 2010 Ok...on a friends site they are using a plogger gallery. I have asked on the forum but did not get a answer that helped or I would get no answer. I am trying to upload some photos to the gallery and am getting errors. So I found a new way to upload photos by ftp into a upload file. But when I try to put them into the appropriate gallery I get an error also, it is different than the other error: Make sure to CHMOD 777 your newly created folders within the uploads directory or else Plogger cannot access them. Plogger cannot CHMOD the directory for you while PHP is in safe mode. Do I need to change permission of the upload file? I don't want to mess this up. Thank you for any help, Corinne The other error when I would log in to plogger and try to import the files was this error : Warning: move_uploaded_file(/home/kozies/public_html/GSDPhotos/images/kozies_german_shepherds/german_shepherd_puppies/photo2.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/kozies/public_html/GSDPhotos/admin/plog-admin-functions.php on line 88 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php86cPy3' to '/home/kozies/public_html/GSDPhotos/images/kozies_german_shepherds/german_shepherd_puppies/photo2.jpg' in /home/kozies/public_html/GSDPhotos/admin/plog-admin-functions.php on line 88 Quote Link to comment Share on other sites More sharing options...
administrator Posted February 10, 2010 Report Share Posted February 10, 2010 Make sure to CHMOD 777 your newly created folders within the uploads directory or else Plogger cannot access them. Plogger cannot CHMOD the directory for you while PHP is in safe mode. Yes, that's exactly it - change the folder permissions and you should be OK. If you have CPANEL it is easy to do with the File Manager. Stefan Quote Link to comment Share on other sites More sharing options...
Corinne Posted February 10, 2010 Author Report Share Posted February 10, 2010 (edited) Make sure to CHMOD 777 your newly created folders within the uploads directory or else Plogger cannot access them. Plogger cannot CHMOD the directory for you while PHP is in safe mode. Yes' date=' that's exactly it - change the folder permissions and you should be OK. If you have CPANEL it is easy to do with the File Manager. Stefan[/quote'] Thank you stefan!!!!!!! What should I change it to it is 777 do I need to change it to 755? "I went into cpanel and the upload file is 755 (i tried )777 and I also went into the upload file and changed each picture to 777 and tried 755 and I still got the same error: Make sure to CHMOD 777 your newly created folders within the uploads directory or else Plogger cannot access them. Plogger cannot CHMOD the directory for you while PHP is in safe mode. Ugh......... Edited February 10, 2010 by Corinne Quote Link to comment Share on other sites More sharing options...
administrator Posted February 10, 2010 Report Share Posted February 10, 2010 You need to give the script execute capability ...try 755. Stefan Quote Link to comment Share on other sites More sharing options...
Corinne Posted February 10, 2010 Author Report Share Posted February 10, 2010 I tried to change permission that did not work. This is also the error Warning: rename(/home/kozies/public_html/GSDPhotos/uploads/amy_einna.jpg,/home/kozies/public_html/GSDPhotos/images/kozies_german_shepherds/german_shepherd_puppies/amy_einna.jpg) [function.rename]: Permission denied in /home/kozies/public_html/GSDPhotos/admin/plog-admin-functions.php on line 94 Would I go in the admin-function file and change something around line 94......I looked and there is a 777 on about line 82 would that need to be changed to 755 ? Here is some of the script down to about line 100: <?php function get_files($directory) { // Try to open the directory if($dir = opendir($directory)) { // Create an array for all files found $tmp = Array(); // Add the files while($file = readdir($dir)) { // Make sure the file exists if($file != "." && $file != ".." && $file[0] != '.') { // If it's a directiry, list all files within it if(is_dir($directory . "/" . $file)) { $tmp2 = get_files($directory . "/" . $file); if(is_array($tmp2)) { $tmp = array_merge($tmp, $tmp2); } } else if (is_readable($directory . "/" . $file)) { $filename = basename(stripslashes($file)); $pi = pathinfo($file); if (is_allowed_extension($pi["extension"])) { array_push($tmp, $directory . "/" . $file); } } } } // Finish off the function closedir($dir); return $tmp; } } function add_picture($album_id,$tmpname,$filename,$caption,$desc) { global $config; $filename_parts = explode(".",strrev($filename),2); $filename_base = strrev($filename_parts[1]); $filename_ext = strrev($filename_parts[0]); $result = array( 'output' => '', 'picture_id' => false, ); $i = 0; $unique_filename_base = strtolower(sanitize_filename($filename_base)); // now get the name of the collection $sql = "SELECT c.path AS collection_path, c.id AS collection_id, a.path AS album_path, a.id AS album_id FROM ".TABLE_PREFIX."albums a, ".TABLE_PREFIX."collections c WHERE c.id = a.parent_id AND a.id = '$album_id'"; $sql_result = run_query($sql); $albumdata = mysql_fetch_assoc($sql_result); // this shouldn't happen in normal cases if (empty($albumdata)) { $result['errors'] .= plog_tr('No such album!'); return $result; } $dest_album_name = SmartStripSlashes($albumdata["album_path"]); $dest_collection_name = SmartStripSlashes($albumdata["collection_path"]); $create_path = $dest_collection_name."/".$dest_album_name; while (is_file('../images/'.$create_path."/".$unique_filename_base . "." . $filename_ext)){ $unique_filename_base = $filename_base . " (" . ++$i .")"; } $final_filename = $unique_filename_base . "." . $filename_ext; // final fully qualified file name $final_fqfn = $config["basedir"].'images/'.$create_path.'/'.$final_filename; if (!makeDirs($config['basedir'].'images/'.$create_path, 0777)) { $result['errors'] .= sprintf(plog_tr('Could not create directory %s!'),$create_path); return $result; }; if (is_uploaded_file($tmpname)) { if (!move_uploaded_file($tmpname,$final_fqfn)) { $result['errors'] .= sprintf(plog_tr('Could not move uploaded file! %s to %s'),$tmpname,$final_fqfn); return $result; } } else if (!rename($tmpname,$final_fqfn)) { $result['errors'] .= sprintf(plog_tr('Could not move file! %s to %s'),$tmpname,$final_fqfn); return $result; }; @unlink($tmpname); $res = chmod($final_fqfn, 0755); Quote Link to comment Share on other sites More sharing options...
Corinne Posted February 11, 2010 Author Report Share Posted February 11, 2010 Hey Stefan If you get a chance could you look at my last post. Thank you, Corinne Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 11, 2010 Report Share Posted February 11, 2010 You shouldn't need to modify the source code to get this to work. Any chance you'd send me the cpanel login and I can go in and check to see that all permissions are set correctly? I'm not sure how much other help we can offer at this point. Quote Link to comment Share on other sites More sharing options...
Corinne Posted February 11, 2010 Author Report Share Posted February 11, 2010 You shouldn't need to modify the source code to get this to work. Any chance you'd send me the cpanel login and I can go in and check to see that all permissions are set correctly? I'm not sure how much other help we can offer at this point. Ben I will send you an email......Thank you, and thank you Stefan for trying to help me!! Corinne Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 11, 2010 Report Share Posted February 11, 2010 Thanks for the email. I believe I got the issue fixed (the folders needed to be set to "777" in order for Plogger to work correctly.) Quote Link to comment Share on other sites More sharing options...
Corinne Posted February 12, 2010 Author Report Share Posted February 12, 2010 Thank you Ben!!! It was the permission that needed to be changed and I must not have been doing it correctly. Thanks Ben for getting it to work!! Corinne Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.