Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Anyone using Dreamhost.com and OSC, please come in.


Guest

Recommended Posts

Posted

I have been trying to find a fix all day for this, and all the countless posts about it have proved useless :(

 

After a successfull installation, everything runs great... that is, everythign except being able to add new product images. I keep getting

 

Warning: open_basedir restriction in effect. File is in wrong directory in /home/.tabatha/sitegoeshere/sitegoeshere.com/admin/includes/functions/general.php on line 789

 

This is a great program, and I'd love to start adding products to it, but this is the only thing holding me back. I'm sure there are many people on here who have found a fix for it, but seeing as how I am php challenged, maybe you could help me out.

 

I apologize for posting this same issue when it has already been discussed to death it seems, but I am desperately trying to find a solution.

 

If anyone can help me out, please IM me at CinisterDP or email me at [email protected]

 

PS. this is what dreamhost has to say about it:

 

If you are having trouble with PHP commands like backticks (``), system(), exec(), passthru(), and others that spawn external commands, or are having trouble with errors like:

 

open_basedir Restrictions in effect, file is in wrong directory

 

Then you've written a script that doesn't quite conform to our security standards.

 

We implement strict security for PHP scripts run by Apache, because otherwise, none of our users would be able to sufficiently secure sensitive information (like Database passwords)!

 

Because PHP normally runs as part of Apache, it runs as Apache's user and group. This differs from CGI scripts, which, because they run as a separate process outside Apache, run as the owner's user and group.

 

To protect your PHP scripts, we've disallowed all PHP functions that would let one user possibly open another user's script (and see sensitive stuff like passwords). Our restrictions work in two parts:

 

Thanks again!

Dan

Posted

What version of osCommerce are you using and what is in line 789 of general.php?

 

Plese quote the surrounding 5 lines too.

 

As soon as we see what that line wants to do we can fix it.

You can't have everything. That's why trains have difficulty crossing oceans, and hippos did not adapt to fly. -- from the OpenBSD mailinglist.

Posted

I'm using OSC v2.2 Snapshot is of 12-04-2002.

 

// name, type, size, tmp_name

 function tep_copy_uploaded_file($filename, $target) {

   if (substr($target, -1) != '/') $target .= '/';



   $target .= $filename['name'];



   move_uploaded_file($filename['tmp_name'], $target);

 }



// return a local directory path (without trailing slash)

 function tep_get_local_path($path) {

   if (substr($path, -1) == '/') $path = substr($path, 0, -1);



   return $path;

 }

 

Line 789 is the: move_uoloaded_file

Posted

OK, reading the PHP manual shows me:

 

http://www.php.net/manual/en/function.move...loaded-file.php

 

Note: When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed.

 

So you better check that owner settings and permissions for your images directory are correct.

 

HTH

You can't have everything. That's why trains have difficulty crossing oceans, and hippos did not adapt to fly. -- from the OpenBSD mailinglist.

Posted

Safe mode is turned off. I checked this by using the Server Info tool, also, all image directories are set to CHMOD 777.

 

I'm going to try and reinstall to see if maybe I made an error when I installed it the first time. I really hope this fixes everything.

Posted

Well, just got done doing a fresh install, and I still keep on getting that same error :(

Posted

Never in my life have I been so frustrated :oops: I shall figure this out!

Posted

I'm on Dreamhost as well and just installed the program and am having the EXACT same problem as you.

 

If you were able to fix it, what did you do?

 

HELPPPP!!! I love Dreamhost and don't want to change hosts.

Posted

First go read this post!

 

http://www.oscommerce.com/forums/viewtopic.php...9395&highlight=

 

Next:

What you need to do is put your full server path in your admin -> configuration -> cache and also create a /tmp chmod 777 dir in your root dir.

 

Example: var/www/httpdocs/tmp

 

If you don't know your server path you can go to admin -> tools -> system info and scroll down and find open_basedir and just cut and paste the dir path.

 

With me both of these fixes got everything working. The first one your provider will have to do and the second you can do.

The error message is caused by PHP Safe mode. And a lot of providers will not turn it off. But I found it doesn't matter.

Steve

-------------------------

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...