Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

image upload problem


sefu

Recommended Posts

Hi All,

 

I've searched for the board but could not find anything that worked.

I am getting the dreaded open_basedir error.

 

I moved over to a new server, from cpanel to plesk. I am having problems uploading images from the admin, it will write to database but the image wont upload. I can ftp the image after but this is time consuming and the reason of the server move was to save time.

 

Here is the exact error I get when I try to upload a image through the admin directory

 

Warning: copy() [function.copy]: open_basedir restriction in effect. File(/tmp/phpwe6uzW) is not within the allowed path(s): (/usr/local/netpbm) in /usr/local/psa/home/vhosts/minidisc.com.au/httpdocs/admin/categories.php on line 501

 

Warning: copy() [function.copy]: open_basedir restriction in effect. File(/tmp/php5vKwAV) is not within the allowed path(s): (/usr/local/netpbm) in /usr/local/psa/home/vhosts/minidisc.com.au/httpdocs/admin/categories.php on line 509

 

Ok reading that error makes me think that the script is trying to temporary write to the tmp folder, and it couldn't because open_basedir is set the /usr/local/netpbm/ which is unreachable from my domain and also unwritable to my knowledge.

 

I confirmed the details by checking the php info and the address that was configured under open_basedir is the following

open_basedir /usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au/httpdocs:/usr/bin/imagemagick/

 

I confronted my host to turn safe mode off which it is now and also asked them to set the open_basedir directory to "no value" however they were reluctant to do so.

 

I am just checking with you guys/girls that change the open_basedir setting the "no value" will fix the problem? Or is there something else I should do to fix it.

 

I'Upload is to set "on" going by the php info page.

 

Please help :(

Link to comment
Share on other sites

This is what my provider did.

 

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au

/httpdocs:/tmp/

or

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au/

httpdocs:/usr/bin/imagemagick/tmp/

 

Pointing to my /tmp/ dir in my root. And now it all work perfectly.

Before they did, I was getting the same errors as you.

Steve

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

Link to comment
Share on other sites

I'm having a similar problem. We just moved our site that has worked flawlessly for the last 6 months from an Ensim server to a Plesk server (at the request of our host, not my idea) and the site is all screwed up now.

 

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

THE QUESTION

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

Where do I find this snippet of code that TOOLCRAZY mentions to change on the server, I have ROOT access. So if you point me in the right direction I'll do the damage.

 

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au 

/httpdocs:/tmp/ 

or 

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au/ 

httpdocs:/usr/bin/imagemagick/tmp/

 

Definitely a session problem when going between secure and un-secure parts of the OSC site.

 

Plus all the other 'opendir' errors, 'header' errors, etc..

 

<BEGIN GRIPE>

THE PLESK APPLIANCE SERVER IS THE BIGGEST WASTE OF TIME. I have installed a few OSC sites on Ensim, cPanel and plain old Linux boxes in just a few hours or less time had working sites.

 

I have spent no less than 16 straight hours fiddling, updating, compiling, updating, fiddling, tweaking and still the site doesn't work. And this is with the help of the web hosts very capable tech support.

 

DIE PLESK DIE!

</END GRIPE>

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

I'm having a similar problem. We just moved our site that has worked flawlessly for the last 6 months from an Ensim server to a Plesk server (at the request of our host, not my idea) and the site is all screwed up now.

 

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

THE QUESTION

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

Where do I find this snippet of code that TOOLCRAZY mentions to change on the server, I have ROOT access. So if you point me in the right direction I'll do the damage.

 

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au 

/httpdocs:/tmp/ 

or 

/usr/local/netpbm:/usr/local/psa/home/vhosts/minidisc.com.au/ 

httpdocs:/usr/bin/imagemagick/tmp/

 

Definitely a session problem when going between secure and un-secure parts of the OSC site.

 

Plus all the other 'opendir' errors, 'header' errors, etc..

 

This is the open_basedir path in the php.ini file. Your host will have to add it unless you have access to that file. Which most of us don't. It is a minor tweak and most host will oblige no problem. Now be sure to put a /tmp/ file in your space root and chmod it to 777.

Steve

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

Link to comment
Share on other sites

[/code]

 

But it still doesn't work for me.

 

In the admin area

Can't update any products. If I do the information vanishes, no image is uploaded and anything I try to modify or add just disappears. I get only an empty product devoid of title, description text, and no upload. In fact if I edit an existing product, whatever info was in the DB disappears.

ucts. If I do the information vanishes, no image is uploaded and anything I try to modify or add just disappears. I get only an empty product devoid of title, description text, and no upload. In fact if I edit an existing product, whatever info was in the DB disappears.

s[/code]

 

But it still doesn't work for me.

 

In the admin area

Can't update any products. If I do the information vanishes, no image is uploaded and anything I try to modify or add just disappears. I get only an empty product devoid of title, descr

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Okay. I see it now. I didn't read the part about looking in the php.ini file. Like I said I've been going for over 16 hours now.

 

I changed my settings to something similiar to the example.

 

open_basedir = /usr/share/pear:/home/vhosts/xxxxx/httpdocs:/tmp/

 

But it still doesn't work for me.

 

In the admin area

Can't update any products. If I do the information vanishes, no image is uploaded and anything I try to modify or add just disappears. I get only an empty product devoid of title, description text, and no upload. In fact if I edit an existing product, whatever info was in the DB disappears.

 

In the front end of the site

I can't login or create a new account. Everytime I enter my information (user/pass) it bounces me back to the same page, except no information from the post, completely blank each time.

 

Any ideas here?

 

thanks for the help.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

What version of PHP are you using?

 

It still sounds like a PHP config problem.

 

Could be, the original install was PHP 4.1.1 but we updated it all the way to PHP 4.3.0. All my working versions ran on PHP 4.2.x.

 

 

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

Environment

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

PHP 4.3.0

Apache 1.3.27

MySql 3.23.54

safe_mode = OFF

open_basedir = /home/httpd/vhosts/xxxxx/httpdocs:/tmp:/usr/share/pear/ -and- /usr/share/pear:/home/vhosts/xxxxx/httpdocs:/tmp/

 

 

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

my config

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

'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-domxml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-mcal' '--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-apxs=/usr/sbin/apxs'

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Update on my OSC, Plesk problem.

 

The good news is - OSC and Plesk on my server are playing nice. Our site is up and running, I did have an odd set of tables in the database go corrupt 48hours after going live, not sure why?

 

I just wanted to post a thank you to all for their advice and suggestions provided by all here on the OSC forums to my previous problem.

 

Even with the assistance of the OSC forum and its members, its still took a 6 hour marathon of email exchanges with a tech support person at Plesk (thank you Pavel) before the site was working. But again I'm happy to report it can be done.

 

As soon as I get back to the office (its the weekend right now) I'll try to post a more comprehensive outline of all that was modified to make this work.

osC details

osCommerce 2.2-MS2

PHP Version: 4.3.8 (Zend: 1.3.0)

Apache Release 10331100

MySQL 4.0.27-standard

Link to comment
Share on other sites

Glad to hear it.

 

My site is currently on a plesk server and my host want to move me to a cPanel server, that is more updated and faster. But, they said they will let me play with the site after it is moved, and if I am happy, they will update the DNS. I hope I don't have the same problems as you.

Steve

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

Link to comment
Share on other sites

  • 4 weeks later...

mrbill, can you tell me how you fixed your problem?

 

I'm having the same problems with oscommerce using plesk - Can't add/update any catagories/products. If I do the information vanishes, no image is uploaded and anything I try to modify or add just disappears.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...