PHP safe mode breaks imagecache?

Posts: 8
Joined: 06/20/2008

Pretty sure this is the right location to post this. Perhaps there is a fix out there but I have searched Google, Drupal forums and this forum backwards and forwards looking for a solution and I can't find it. The issue is that I have a ubercart install on a server with PHP safe mode enabled. This seems to keep users from being able to upload image files because of something that imagecache is doing with the files. Maybe the permissions are set wrong, however I've tried numerous variations with no success. I don't receive this error on my local development server which has an exact copy of the site. Any help or suggestions?

The exact error messages are:

    warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 10118 is not allowed to access /tmp/tmp_pOoP3L owned by uid 48 in /var/www/vhosts/musiccitycardsandgifts.com/httpdocs/new/includes/file.inc on line 241.

--

My Blog: Nullvariable

Posts: 5367
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I don't suppose you're using Drupal in private files mode, are you?

Posts: 1314
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Safe mode can be turned off anyway. I think it's even recommended in the Drupal handbooks (and in the Status report as well). If the server still needs protection within the folder structure you can always setup an open_basedir restriction, specifying which directories are allowed for PHP to access.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 8
Joined: 06/20/2008

@torgosPizza
sadly many hosting providers on shared hosting will not turn safe mode off. In this case I don't have access to the server, merely a weak permission hosting account. If the only solution is to move hosting providers that can be done but I'd rather avoid having to do that if at all possible.

@Ryan
I have no idea, I just used the default package from this site...how would I check?

--

My Blog: Nullvariable

Posts: 85
Joined: 02/14/2008
Bug FinderGetting busy with the Ubercode.Internationalizationizer

http://yourdomain.com/admin/settings/file-system leave it public and check if a temporary directory was created. This also breaks things.

While safe mode probably really doesn't provide the security the providers would like to achieve with it, it is not impossible to get things working with safe mode on. I once managed it, but the key was that I could change the owner of my (drupal) files after upload (from ftp_user to apache or root - not sure now), so again no solution for you. Maybe you could ask the service of your provider to do this for you? It is a few click action.

Google around - there are very much posts about this issue.

Posts: 1314
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Yeah I have been with Shared hosting providers, and most times they will just turn it off if you ask them. If they aren't a completely fly-by-night operation they should accommodate you. GoDaddy is usually pretty good at that, if that's who you are with.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 8
Joined: 06/20/2008

well I'm not sure who shes with but we got it turned off and that seems to have fixed all the issues. Thanks for the suggestions!

--

My Blog: Nullvariable