Koozali.org: home of the SME Server

getImageSize problem.

Offline alexkarpi

  • *
  • 7
  • +0/-0
    • http://www.twelvepro.com
getImageSize problem.
« on: September 21, 2006, 04:13:58 AM »
Using one of the shopping cart (pinnaclecart) on SME 7.
Software installed with no problems. Now when I try to upload image, I have error:

Can't upload product image. Incorrect image type: image/pjpeg

Contacted tech support and after test they stated:

On your server 'getImageSize' function is not getting executed.

Do any one can help me to fix it. Please ....
Alex K
alexk@twelvepro.com
www.twelvepro.com

Offline JonB

  • *
  • 351
  • +0/-0
getImageSize problem.
« Reply #1 on: September 21, 2006, 01:43:46 PM »
Your issue is due to the security settings that SME imposes on PHP run in an Ibay. It is known as PHPBaseDir restrictions.

By default PHP in an Ibay cannot access the /tmp directory which is where uploaded images are temporarily stored.

You have 2 options.

1 - Create a /tmp directory within the Ibay and modify the PHP scripts to use this for temp upload

2 - Allow PHP to access the /tmp directory by changing the PHPBaseDir restriction on the Ibay. Be aware that this may constitute a security risk.

From console


Code: [Select]
db accounts setprop <ibayname> PHPBaseDir /home/e-smith/files/ibays/<ibayname>/:/tmp
/sbin/e-smith/signal-event ibay-modify <ibayname>


Jon
...

Offline alexkarpi

  • *
  • 7
  • +0/-0
    • http://www.twelvepro.com
getImageSize problem.
« Reply #2 on: September 21, 2006, 02:43:49 PM »
Thank you for qiusk response.
I just wondering how bad is second solution for security risk?
I contacted software vendor and ask them to modify PHP script.
I can't do it by my self bicouse software is incripted.
If they refuse make changes I would like to know more about security risk
with second solution. In the same time I am running Copermine photo galleriy on the same server and never had any problems with uploading
immages. To me Copermine has a beter free sript then software I paid for
(Pinnacle cart).

Again tank you for your help.
Alex K
alexk@twelvepro.com
www.twelvepro.com

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
getImageSize problem.
« Reply #3 on: September 21, 2006, 04:42:36 PM »
I would confirm that Option 2 solves your problem prior to requesting a change to the script.

To undo option 2, do the following...

Code: [Select]
db accounts delprop <ibayname> PHPBaseDir
/sbin/e-smith/signal-event ibay-modify <ibayname>
Regards,
William

IF I give advise.. It's only if it was me....

Offline alexkarpi

  • *
  • 7
  • +0/-0
    • http://www.twelvepro.com
getImageSize problem.
« Reply #4 on: September 21, 2006, 04:58:42 PM »
After I made changes on my server IT WORKS :lol:

Ok, so back to my question how it will compromise my server security?
Can stay with that setting or start pushing software wendor to make changes
in script?
Alex K
alexk@twelvepro.com
www.twelvepro.com

Offline alexkarpi

  • *
  • 7
  • +0/-0
    • http://www.twelvepro.com
getImageSize problem.
« Reply #5 on: September 21, 2006, 08:32:52 PM »
I get reply from sotware support:

Please see this documentation on changing your upload temporary directory.  Make sure it fits into the php restriction path.
Contact your host with this information so that they can set it properly for you.  If you are to modify the pinnacle cart source base you will lose our full support plan.  Please try this first.

http://us2.php.net/manual/en/ini.core.php#ini.upload-tmp-dir

Can you tel me if it helps to resolve my problem? Sorry for so meny questions, I still lerning.

Big thank you for your help.
Alex K
alexk@twelvepro.com
www.twelvepro.com