failed to open stream: Permission denied in blablabla upload.php on line 1197 failed to open stream: Permission denied in blablabla upload.php on line 1197
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

failed to open stream: Permission denied in blablabla upload.php on line 1197

Started by linuxhata, October 26, 2005, 07:26:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

linuxhata

Hello.

I've moved existing gallery install to another host. copied all files, edited include files as followed, set permissions, exported base and re-imported it to new host. Everything works ok exept adding new photos. I'm getting this error:

Warning: move_uploaded_file(./albums/edit/mHTTP_temp_b46916b1.jpg): failed to open stream: Permission denied in /mounted-storage/home7/sub003/sc14289-FOQH/damireke.com/upload.php on line 1197

That happens when I try to add files in admin mode. with anon user, I'm simply getting "Destination directory albums/userpics/ is not writable by the script ! ", I've checked it, it's set to 755, tried 777, no luck

what can I do?

Joachim Müller

1) Update to the most recent version cpg1.3.5
2) search the board for your error message before posting, this has ben asked a million times

linuxhata

I've searched, but all I get is people asking such question, and they are sent to search, and no ideas how to fix that

Joachim Müller

did you update to cpg1.3.5 as I suggested?
Go through your search results from oldest to newest instead from newest to oldest and you'll get answers. After the ten millionth posting that asked the same, supporters became reluctant to answer, so they told people to search instead of posting the same thing over and over again. Actually, updating will solve all issues you have!

linuxhata

No I haven't upgraded yet and I don't think it's good idea for me, I have a lot of customisations done by myself, don't want to loose them.

I've found this:

When I try to upload a picture I get the error message Impossible to move somepic.jpg to albums/userpics/ | Warning: move_uploaded_file(/tmp/phpezCYKr) [function.move-uploaded-file]: failed to create stream: Operation not permitted. What's wrong?
You should contact the admin of your webhost because usually you can't change the location of the temporary directory for file uploads yourself (it is part of PHP configuration) .
If the open basedir restriction is in effect on your site then the temp directory for file uploads should be one that you can access.

But, for what should I ask my host support?

Joachim Müller


linuxhata

Well, I did upgrade.

still can't upload

Destination directory albums/userpics/ is not writable by the script !

Joachim Müller

CHMOD as suggested. If you can't, then there's an ownership issue - CHOWN. If you're not allowed to do this, ask your webhost to CHOWN for you.

linuxhata

What EXACTLY I should ask for?
if I'm getting:

Warning: move_uploaded_file(./albums/edit/mHTTP_temp_2a001d0b.jpg): failed to open stream: Permission denied in /mounted-storage/home7/sub003/sc14289-FOQH/damireke.com/upload.php on line 1197

Warning: move_uploaded_file(): Unable to move '/tmp/phpn7jUm9' to './albums/edit/mHTTP_temp_2a001d0b.jpg' in /mounted-storage/home7/sub003/sc14289-FOQH/damireke.com/upload.php on line 1197

Joachim Müller

CHMOD 777 or 755 (depending on your server config) as suggested in the docs. If this doesn't help, ask them to CHOWN to make the albums folder and everything in it owned by the user the webserver serive runs under. Again: use the search, as this has been discussed.

linuxhata


kegobeer

Check your /tmp folder and see if you have permission to move files.  Ask your host about it.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

linuxhata

I've checked everything again. For some strange reason, upload with anon now works, it doesn't works with registered users.

kegobeer

Quote from: linuxhata on October 27, 2005, 09:02:40 PM
I've checked everything again.

Permissions for the /tmp folder (not accessible via any FTP client) were never suggested; did you ask your host about it?

Quote from: linuxhata on October 27, 2005, 09:02:40 PM
For some strange reason, upload with anon now works, it doesn't works with registered users.

If you haven't changed anything, this is most likely an issue with your webhost.

Things you should read:

General upload troubleshooting:
General upload troubleshooting.
Troubleshooting the upload process.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

linuxhata

Reasons it started working is that host support set chmod 777 to it from "their" account.

I've re-checked with various usernames, problem is only when using registered user.

I'll ask them to change permissions for tmp folder, thanks.

linuxhata

I've fixed it. The problem is, that CHMODding main directory won't chmod sub-folders. I've chmodded them manually and problem is gone.

kegobeer

If you have a control panel application, usually changing permissions on the parent transfers to the child; FTP clients may or may not work the same way.  Mileage may vary.   ;)
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

linuxhata

Yes. CuteFTP won't CHMOD sub folders, that was the problem. Used site control panel instead - everything just fine now. (through I've lost my language localisation, since I was forced to upgrade to 1.35)

Joachim Müller

restore your language file from your backup - the language files didn't contain bugfixes anyway.

linuxhata

Thanks!

Everything is fine now!

One more question. "This category contains albums that belong to Coppermine users." - where this text is located? I was unable to find it in english-utf8, but I do need it to translate