Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help needed from linux specialist


Guest

Recommended Posts

Hi folks,

 

i'm trying to split a big oscommerce shop in three smaller oscommerce-solutions. The solutions should use the same products and therefore the same images in three different admin areas too .

 

Do do this, i'm using one database with seperate tables for every shop. Only the products table will be the same for all shops. This is working fine.

 

But now i got another Problem. To share the product-images in the three shops i decided to hold all images in a seperate directory outside of the webspaces of the shops and to replace the original images-directory by a symbolic link to this directory in every shop installation.

 

The frontend (shop-section) is working fine with this solutions. The images of the products will be shown by every shop. But i got a strange error in the admin-section. When i click on the catalog i got an errormessage that the directory "images" does not exist. Changing admin/categories.php in line 380 from

 

  if (is_dir(DIR_FS_CATALOG_IMAGES)) {
if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
 } else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }

 

to

 

  if (is_dir(DIR_FS_CATALOG_IMAGES) || is_link(DIR_FS_CATALOG_IMAGES)) {
if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
 } else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
 }

 

does not bring any success. The error still remains!

 

This is quite confusing me and freaks me out ... the images can be read in the frontend of the shop but will not be shown in the admin-interface. But all settings in admin/includes/configure.php are correct and the same like in shop/includes/configure.php (except the special admin constants).

 

It seems that there is a problem width the user-rights. The whole installation takes place on a debian-linux-installation with three virtual hosts (shop1 to shop3) and a separate directory for the images. The directorystructure is looking like this:

 

htdocs/shop1/... User:shop1, Group: webusers

htdocs/shop2/... User:shop2, Group: webusers

htdocs/shop3/... User:shop3, Group: webusers

htdocs/multishop_images/... (contains the shopimages) User: www, Group:webusers with S-Bit set for the group, rights: 777

 

Webserver: Apache 1.3, running as User: www, with group nogroup and three virtual hosts (shop1 to shop3) with users shop1, shop2, shop3 and a single group called webusers.

 

The last thing i should say is that every Apache (virtualhost) user is running it's own php-binary with its own php.ini.

 

Does anyone know a solution?

 

Thanx in advance

 

Udo

Link to comment
Share on other sites

You're reinventing the wheel - it's already been done.

 

Go to this link:

 

http://www.oscommerce.com/community/contri...rch,Multi+Store

 

Vger

 

Sure,

 

thats what i would do also. But the shop owner don't want to use this conrib. So i have to find another solution.

 

After all i got a little success. It seems that one of the problems will be caused by the open_basdir-restriction in php.ini. After clearing this var i got a successfull run of a command line script in the webspace of one of the shops which was testing the image-directory for me. Also the error in admin section that the image-directory doesn't exist is also gone away.

 

But some things still remain. The images will not be shown in the adminsection and in the store-section the imagesize for named small images could not be calculated because of getimagesize in html_output.php. It seems that php is just checking the userrights to deal with the images.

 

And the users of the shop-directory and the image-directory are still different. Only the groups are the same. Now i'm trying to change php in that way that it should only check the grouprights instead of userrights on fileoperations. Hope this helps me.

 

Greetings

 

Udo

Link to comment
Share on other sites

The images will not be shown in the adminsection and in the store-section the imagesize for named small images could not be calculated because of getimagesize in html_output.php

 

Does this apply across all domains? This function relies (as I understand it) upon GD Library being installed on the server, and i know that there are problems with some older versions of GD.

 

As for the shop owner not wanting to use the contribution, he or she would have to have a good reason not to use it if I was building the site for them. Shop owners come to site builders/developers in the first place because they don't have the knowledge to do it themselves.

 

Vger

Link to comment
Share on other sites

Does this apply across all domains? This function relies (as I understand it) upon GD Library being installed on the server, and i know that there are problems with some older versions of GD.

 

As for the shop owner not wanting to use the contribution, he or she would have to have a good reason not to use it if I was building the site for them. Shop owners come to site builders/developers in the first place because they don't have the knowledge to do it themselves.

 

Vger

 

The version of the installed gd-lib is the version 2.0.15. It seems that it depends only on the userrights! When i change the owner of the image-directory to one of the owners of the shops (e.g. "shop1") everything works fine in the admin tool. After the change i'm able to make upload and to view the images in the admin-area. But when i change the user to the apaches default-user (www) no image will be shown.

 

I tried to change php in that way that it should only check the group-rights because all shopusers (shop1 to shop3) are in the same group and the shop-directories and image-directory are marked to belong to this group, but this does not work. First there is no var i could change in php.ini except the "safe_mode_gid"-var. But if i change this var nothing happens. "getimagesize" gives only the needed informations when the user of the images is the same as the user in one of the shops.

 

Not to use the multi-store-contrib by the shopowner depends on the fact that it should not be compatible with all contribs. That's why he won't use this.

 

Greetings and Thanks

 

Udo Gerhards

Link to comment
Share on other sites

The version of the installed gd-lib is the version 2.0.15. It seems that it depends only on the userrights! When i change the owner of the image-directory to one of the owners of the shops (e.g. "shop1") everything works fine in the admin tool. After the change i'm able to make upload and to view the images in the admin-area. But when i change the user to the apaches default-user (www) no image will be shown.

 

I tried to change php in that way that it should only check the group-rights because all shopusers (shop1 to shop3) are in the same group and the shop-directories and image-directory are marked to belong to this group, but this does not work. First there is no var i could change in php.ini except the "safe_mode_gid"-var. But if i change this var nothing happens. "getimagesize" gives only the needed informations when the user of the images is the same as the user in one of the shops.

 

Not to use the multi-store-contrib by the shopowner depends on the fact that it should not be compatible with all contribs. That's why he won't use this.

 

Greetings and Thanks

 

Udo Gerhards

 

On thing i forgot: The problem occurs on all domains!

 

Greetings

 

Udo Gerhards

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...