PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   Troubleshooting & Problems (http://www.photoplog.com/forum/forumdisplay.php?f=6)
-   -   No uploads and a message (http://www.photoplog.com/forum/showthread.php?t=13)

ka$h 01-11-2006 08:33 PM

No uploads and a message
 
I can't upload pics and get this message when I try:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid/gid is 6344/6344 is not allowed to access /mounted-storage/home8/sub003/sc15378-GJSN/www/photoplog/images/793 owned by uid/gid 99/99 in /mounted-storage/home8/sub003/sc15378-GJSN/www/photoplog/upload.php on line 143

I assume looking at the title that it's because SAFE MODE is on. I cannot change this as I don't have access to do so. A solution please?

K

ka$h 01-11-2006 09:44 PM

I also ge tthis error in the middle of the page:

Sorry, ka$h: Bad Type

Part of the same I hope, but I could do with some help :(

K

Morgan 01-11-2006 09:58 PM

Is the images directory set to 777 permissions? If so, and you still cannot upload, ask your host if they will change UID (user) checking to GID (group) checking so you can upload. Here's a link to safe_mode_gid. It's something that needs to be set in the php.ini or httpd.conf file.

ka$h 01-11-2006 10:11 PM

Quote:

Originally Posted by Morgan
Is the images directory set to 777 permissions? If so, and you still cannot upload, ask your host if they will change UID (user) checking to GID (group) checking so you can upload. Here's a link to safe_mode_gid. It's something that needs to be set in the php.ini or httpd.conf file.

Yeah, images is 777 and that's the probs I get. I can ask host to change that, I'll have to read that link throurghly now to see where this is going as it's losing me a bit now. All will be come clear soon I hope. Thanks so far mate ;)

Morgan 01-11-2006 10:27 PM

Not sure if you saw it on that page, but if you look for the sentence that starts with "When safe_mode is on, PHP checks to see if the owner of..." there is some more talk about UID/GID stuff that may be of some help. Let me know how it goes. :)

ka$h 01-12-2006 04:21 PM

Right, although the servercp says that I am running SAEF MODE I was also running gid safe mode. To keep security on the shared server I changed the option for gid safe mode to off and it gives exactly the same, so that aint it.

In addition to this I switched the vb options for server safe mode to on and it refused to allow attachments to be uploaded. I switched back to off and it works fine. This makes me think it aint the server but something else.

Don't really want to be turning the SM off in the CP, and it's taking 2-3 hours for settings to change so it's not something I can tryout quickly if you know what I mean.

Any more thoughts?

ka$h 01-12-2006 04:23 PM

Just double checked the error and it has actually changed by dropping the gid part of the error:

Quote:

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 6344 is not allowed to access /mounted-storage/home8/sub003/sc15378-GJSN/www/photoplog/images/793 owned by uid 99 in /mounted-storage/home8/sub003/sc15378-GJSN/www/photoplog/upload.php on line 143
K

Morgan 01-12-2006 04:27 PM

Does the 793 directory have 777 permissions?

ka$h 01-12-2006 04:28 PM

it certainly does

Morgan 01-12-2006 06:19 PM

Regarding safe mode, there is a blog (http://ilia.ws/archives/18-PHPs-safe...-security.html) where the last comment says:
Quote:


Take a look at my PHP patch at:
http://www.titov.net/safemodepatch/

it allows PHP scripts to operate on files/directories owned by ther web-server user if they reside in directories, owned by "the right" user /or if they reside in directories owned by web-server user and parent directory is owned by the "right user"/.
#8 Anton Titov (Link) on 2004-09-26 09:55 (Reply)

The issue you're experiencing with safe mode is because the PHP script has its own UID/GID (6344/6344) but the directory where the uploaded files are to go has a different UID/GID (99/99) and as 6344 != 99 you get the error message.

You could try Titov's patch, if you are server admin, or else try to convince your host to apply the patch. Alternatively, there is a page (http://bugs.php.net/bug.php?id=24604) where the last comment says:
Quote:


[15 Oct 2004 10:28am CEST] paulo dot matos at fct dot unl dot pt

A workaround/solution to this problem on *nix

Assuming that httpd server runs as apache/apache (uid/gid), and php
script is user/group.

1) php.ini
safe_mode = On
safe_mode_gid = On

2) Create initial data directory, on install phase as:

mkdir /path/to/datadir
chown user.group /path/to/datadir
chmod 2777 /path/to/datadir

3) Create all subdirectories (within php), like:
mkdir(/path/to/datadir/subdir, 02777);

This way all subdirectry will inherit group from initial parent dir and
SAFE_MODE won't complain, since all subdirs
and files will be apache.group.

IMPORTANT NOTE: After any subdirectory creation you shouldn't change
directory permissions, otherwise it will loose
the GID bit and all files/subdirectories created afterwards won't have
group inherited!



All times are GMT. The time now is 12:36 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.