I just moved to a new server.
Everything looks fine, but when trying to upload a photo I get the following error above my header:
Warning: move_uploaded_file(./albums/edit/mHTTP_temp_a89b21f9.jpg): failed to open stream: Permission denied in /home/stfusaco/public_html/gallery/upload.php on line 1238
Warning: move_uploaded_file(): Unable to move '/tmp/php1TkGC8' to './albums/edit/mHTTP_temp_a89b21f9.jpg' in /home/stfusaco/public_html/gallery/upload.php on line 1238
As well I get the following message:
Error Report
The following uploads encountered errors:
Photos to Send:
File Name/URL Error Message
1. Water lilies.jpg Impossible to move.
I tried with both IMAGEMAGICK, and GD.
Any ideas?
Thank you.
http://coppermine-gallery.net/tutorial/uploads/troubleshooting.php
Sounds like you're using an outdated version. Make sure that you have at least cpg1.3.5 or better
I am using an outdated version. 1.3.4
I dont want to upgrade because of the many additions I have on my gallery.
I am going to show the error in debug mode. Hopefully someone will be able to help me.
do exactly as suggested in the troubleshooting tutorial...
Here is the critical error I recieved:
Critical error
Destination directory albums/userpics/10028/ is not writable by the script !
File: /home/stfusaco/public_html/gallery/db_input.php - Line: 242
Here is what debug said:
USER:
------------------
Array
(
[ID] => ba6dec0b6f246a40e1f9468bb3ebc290
[am] => 1
[liv] => Array
(
[0] => 2268
[1] => 2296
[2] => 2300
[3] => 2299
[4] => 2342
)
[search] => ###ziino
)
==========================
USER DATA:
------------------
Array
(
[user_id] => 28
[user_group] => 2
[user_active] => YES
[user_name] => wstein
[user_password] => ********
[user_lastvisit] => 2006-05-19 00:07:12
[user_regdate] => 2005-09-23 18:09:42
[user_group_list] =>
[user_email] =>
[user_website] =>
[user_location] =>
[user_interests] =>
[user_occupation] =>
[user_actkey] =>
[disk_max] => 0
[disk_min] => 0
[can_rate_pictures] => 1
[can_send_ecards] => 1
[ufc_max] => 0
[ufc_min] => 0
[custom_user_upload] => 0
[num_file_upload] => 5
[num_URI_upload] => 1
[can_post_comments] => 1
[can_upload_pictures] => 1
[can_create_albums] => 0
[has_admin_access] => 0
[pub_upl_need_approval] => 1
[priv_upl_need_approval] => 0
[group_name] => Captain
[upload_form_config] => 0
[group_quota] => 0
[can_see_all_albums] => 0
[group_id] => 2
[groups] => Array
(
[1] => 2
)
)
==========================
Queries:
------------------
Array
(
[0] => SELECT extension, mime, content FROM cpg134_filetypes;
[1] => SELECT * FROM cpg134_users WHERE user_id='28'AND user_active = 'YES' AND user_password != '' AND BINARY MD5(user_password) = 'a2c2a3290843f7d98d3710348e2c7627'
[2] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as priv_upl_need_approval FROM cpg134_usergroups WHERE group_id in (2)
[3] => SELECT group_name FROM cpg134_usergroups WHERE group_id= 2
[4] => DELETE FROM cpg134_banned WHERE expiry < '2006-05-19 00:07:32'
[5] => SELECT * FROM cpg134_banned WHERE ip_addr='24.5.192.170' OR ip_addr='24.5.192.170' OR user_id=28
[6] => DELETE FROM cpg134_online WHERE last_action < NOW() - INTERVAL 60 MINUTE
[7] => SELECT * FROM cpg134_online WHERE user_id='28'
[8] => UPDATE cpg134_online SET last_action = NOW() WHERE user_id = '28' LIMIT 1
[9] => SELECT category FROM cpg134_albums WHERE aid='94' and (uploads = 'YES' OR category = '10028')
)
==========================
GET :
------------------
Array
(
)
==========================
POST :
------------------
Array
(
[album] => 94
[MAX_FILE_SIZE] => 102400000
[title] => one
[caption] => two
[keywords] => three
[event] => picture
)
==========================
Page generated in 0.199 seconds - 10 queries in 0.002 seconds - Album set :
If someone could help that would be great.
Perhaps its permissions?
if you moved make sure the folders and files have proper permissions (chmod and chown). Happens with tar/gz+ftp that the owner is still the one from your old host
If you actually need support, please do as I suggested and read the tutorial I refered to (told you so twice already). You're not suppossed to post debug_output, but to post a non-admin test user account with upload privileges after having applied the settings mentioned in the tutorial ::).
Ok GauGau,
You can login as guest.
username ****
password ****
OK, the error message I got was
QuoteFailed to create directory albums/userpics/10041 !
File: /home/stfusaco/public_html/gallery/db_input.php - Line: 229
Warning: mkdir(albums/userpics/10041): Permission denied in /home/stfusaco/public_html/gallery/db_input.php on line 228
Did you set permissions on the albums folder and everything within it as suggested in the docs? If yes, you will have to ask your webhost for support. However, it's mandatory to upgrade, as leaving your gallery as is will leave your site vulnerable to attacks.
Ok I will check with permissions as mentioend in the docs.
Will it be difficult to upgrade if there are a lot of minor hacks on the gallery?
Hmm,
In the documentation, I noticed that I had to CHMOD /albums to 755.
It seemed already to be at 755. I set it anyway, and it still hasnt fixed the problem.
I looked through the downloaded documentation and I couldnt find other files to alter.
Are there other files to CHMOD besides /albums?
You need to CHMOD all the subfolders of albums too. The docs say 777/755, depends on server setup.
Ok, well I changed ALL the folders in /albums as well as /include to 777 and the error went away.
Now, basically I am given the following message after submit:
The previous file could not be placed.
actually, the error message is
QuoteThe file 'albums/userpics/10041/Beispiel.jpg' can't be inserted in the album
Error executing ImageMagick - Return value: 127
Cmd line :
/usr/local/bin/convertconvert -quality 75 -antialias -geometry 100x74 -unsharp 0.5x0.707106781187+0.8+0.03 'albums/userpics/10041/Beispiel.jpg' 'albums/userpics/10041/thumb_Beispiel.jpg'
The convert program said:
sh: line 1: /usr/local/bin/convertconvert: No such file or directory
File: /home/stfusaco/public_html/gallery/db_input.php - Line: 305
This means that you have specified the wrong path to ImageMagick, or that you don't have ImageMagick at all. Switch "method for uploading pics" to GD2 in coppermine's config or specify the proper path to ImageMagick.
In the future, do as suggested - I already told you to do what is being recommended in the upload troubleshooting tutorial - I did exactly that and was able to come up with that error message.
Noticing the error,
/usr/local/bin/convertconvert
It has been changed by changing the path to:
/usr/local/bin/
Thank you for your help guys.