Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My own little open_basedir problem. Pls Help.


ohblah

Recommended Posts

Posted

Hiya

 

It has taken two late nights (or very early mornings) :blink: , and three recharges of my prepaid internet account... and nada.

 

I'm hosted on a Linux server, but clearly I know nothing, so I use Cpanel to do all the dirty stuff. I've read possibly every open_basedir post on 2 forums, and nowhere does there seem to be a standard answer, or an answer period.

 

I get this error when I try to upload images to the default director that osC has set. I had another inferior cart running on exactly the same server, no problems uploading the images.

 

Here are the specs:

 

According to Cpanel:

WWW directory: /home2/wrapped/public_html

Root directory: /home2/wrapped

 

PHP says about open_basedir:

open_basedir /home2/wrapped/:/usr/lib/php:/usr/local/lib/php:/tmp no value

 

I only have this one problem. It's when I upload images for the catalog:

 

Warning: move_uploaded_file(): open_basedir restriction in effect. File(/home2/wrapped/public_html/catalog/images/25.jpg) is not within the allowed path(s): (/home2/wrapped/:/usr/lib/php:/usr/local/lib/php:/tmp) in /usr/home2/wrapped/public_html/catalog/admin/includes/classes/upload.php on line 94

 

I think originally it was copy(), so one post suggested changing it to move_uploaded_file() - but the error stays the same.

 

Here also is catalog/admin/includes/configure.php:

<?php

/*

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright © 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

  define('HTTP_SERVER', 'http://www.wrappedwilly.com'); // eg, http://localhost - should not be empty for productive servers

  define('HTTP_CATALOG_SERVER', 'http://www.wrappedwilly.com');

  define('HTTPS_CATALOG_SERVER', '');

  define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module

  define('DIR_FS_DOCUMENT_ROOT', '/home2/wrapped/public_html/catalog/'); // where the pages are located on the server

  define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required

  define('DIR_FS_ADMIN', '/home2/wrapped/public_html/catalog/admin/'); // absolute pate required

  define('DIR_WS_CATALOG', '/catalog/'); // absolute path required

  define('DIR_FS_CATALOG', '/home2/wrapped/public_html/catalog/'); // absolute path required

  define('DIR_WS_IMAGES', 'images/');

  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

  define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

  define('DIR_WS_INCLUDES', 'includes/');

  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

  define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

// define our database connection --> removed for you know why

 

 

 

 

 

 

 

?>

 

I have developed the cart offline on WinXP IIS and was exceptionally impressed with this superior product, and nearing completion I installed it live (fresh) only to find this annoying hiccup. My cart is paralized, your assistance is most valued.

 

Desperately yours

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

One day I will be a newie no more

Posted

This may be a roundabout way to do it, but since you're on a cPanel server, it might help if you install a second instance of osCommerce through the Add-od Scripts in your control panel. You can then compare the config file in the new install with the one you posted here and see if there are any obvious differences.

 

Another thing you can check: look at the phpinfo file (admin>>Tools>>Server Info) and do a find on "open_basedir." If the setting is something other than "no value" then you might have to install osCommerce in the directory shown there.

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. ~ Benjamin Franklin, 1759. տլ

Posted

Hi Mary,

 

Thanks for the prompt reply -

 

PHP Info has the following for open_basedir:

open_basedir /home2/wrapped/:/usr/lib/php:/usr/local/lib/php:/tmp no value

 

:huh: Does that mean I have to install it in the directory above public_html? I thought all my http accessed pages were supposed to go in public_html.

 

:wacko: The other option of installing a second instance of osC. I have a section at the bottom of Cpanel "Pre Installed Scripts". "Addon Scripts" is an option, but when I click on it, it only lists phpBB & advance Guestbook as options, and no options to add anything additional.

 

Does the fact that I can upload through another program not focus the possibilities of the errors though ?

 

Any thoughts ??

 

Thanks again.

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

One day I will be a newie no more

Posted

The PHP bug is described here: http://bugs.php.net/bug.php?id=19292

 

or here: http://bugs.php.net/bug.php?id=21885

 

You can also get this error if PHP is running in safe mode(must be off!)

 

You could try to create a 'temp' directory in admin/ and add a directive to catalog/.htaccess:

 

php_value upload_tmp_dir /home2/wrapped/public_html/ 
catalog/admin/temp/

 

chmod the directory 777

 

Matti

Posted

Hi Matti - all the advice didn't work. I think a setting on my server prevents the reading of .htaccess files, becuase just pasting what you've given me into the docs in the relevant dir didn't do nuffink. Also, safe mode IS off.

 

I've given up and created a cheat according to another user's advice. I fill in the product as normal, upload nuffink, and then change the property of the prod. in the database. Not ideal, but at least I can use the cart.

 

Could it have something to do with the fact that one of the allowed directories /tmp, actually resides in my home2/wrapped/ directory ? Ie. home2/wrapped/tmp/ - could osC maybe be referring to where it should be (/tmp right?) instead of where it is ?

 

Thanks again for the input. My frustration level is high. :blink:

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

One day I will be a newie no more

Archived

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

×
×
  • Create New...