Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

open_basedir /var/tmp?


PThomas

Recommended Posts

Hi,

wondering if anyone has seen this message before:

 

Warning: copy(): open_basedir restriction in effect. File(/var/tmp/phpih2iQQ) is not within the allowed path(s):

 

I get this when trying to upload an image in admin.

 

-- now it seems our ISP has implemented open_basedir restrictions recently and /var/tmp is not within that the allowable path. However, I am now sure why oscommerce is using /var/tmp as default. I've grepped -R for all existence of /var/tmp in the whole oscommerce directory and subdirectories and there wasn't any. Any tmp references in the file points to /tmp

 

-- got the ISP to add the /var/tmp as an allowable directory, restarted apache, but this hasn't resolved the issue. (I was using an example on the forum which addresses a similiar , but slightly different issue.

 

Any insights would be much appreciated.

 

PT.

Link to comment
Share on other sites

Check in your Admin panel as your cache or your sessions are most likely being stored in the /var/tmp folder. ;)

 

As these settings are stored in your database, they would not be returned from a grep.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

/var/tmp is the ISP's default directory as defined in php.ini. Note: on some systems (e.g. Solaris), /tmp will be symlinked to /var/tmp.

 

Incidentally, /var/tmp is a very sensible default. /var is where changing files should go. This is clearly a temporary file (it exists for less than a second). Uploads should go somewhere outside the web hierarchy (i.e. someplace that cannot be reached by http://domain.com/whatever), and /var/tmp is outside it.

 

As for why it might not be working, check to make sure that /var/tmp is world writeable (777). For debugging purposes, you might want to add a check in the code to see if the file exists.

 

Hth,

Matt

Link to comment
Share on other sites

Thanks for your help guys. Still no luck.

 

I've check /var/tmp and it is chmod to 777. /tmp is not symlinked to /var/tmp in this case.

 

I've also checked the cache and session log paths in admin and any directory reference is pointed to /tmp/.

 

 

 

PT.

Link to comment
Share on other sites

If you are still receive that same message after your ISP added the path, then something is wrong with the configuration and your host needs to take a look at it.

 

If the path was allowed you would not still be getting the error.

 

If anything, you would get an error that you do not have rights to the path or something like that.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...