Page 1 of 1

OSCOMMERCE after ART updates

Posted: Sat Mar 17, 2007 11:45 am
by jmackenz
Howdy,

I had an oscommerce implementation running prior to doing the ART updates on PHP etc, which now appears to be out of commission.

I'm getting the following when attempting to get to the administration page
[client 24.58.134.201] PHP Warning: main() [<a href='function.main'>function.main</a>]: open_basedir restriction in effect. File(/usr/share/pear/includes/languages/english/) is not within the allowed path(s): (/var/www/vhosts/oldforgepewter.com/httpdocs:/tmp) in /var/www/vhosts/oldforgepewter.com/httpdocs/store/admin/includes/application_top.php on line 142
[client 24.58.134.201] PHP Warning: main(includes/languages/english/) [<a href='function.main'>function.main</a>]: failed to open stream: Operation not permitted in /var/www/vhosts/oldforgepewter.com/httpdocs/store/admin/includes/application_top.php on line 142
[client 24.58.134.201] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/share/pear') in /var/www/vhosts/oldforgepewter.com/httpdocs/store/admin/includes/application_top.php on line 142
[client 24.58.134.201] PHP Fatal error: Cannot re-assign $this in /var/www/vhosts/oldforgepewter.com/httpdocs/store/admin/includes/classes/upload.php on line 31
When attempting to go to a category, it just goes back to main page and states the following in the log :
[Sat Mar 17 11:31:50 2007] [error] [client 24.58.134.201] Directory index forbidden by rule: /var/www/vhosts/oldforgepewter.com/httpdocs/store/
The Store can be found @ www.oldfogepewter.com/store

Any help is most greatly appreciated.

Thanks
- John

Posted: Sat Mar 17, 2007 12:45 pm
by scott
PHP 5 is much more strict about path enforcement than 4 was. I think this has been covered in other threads, and as I recall, oscommerce was one of those packages (at least in the past) that was not compatible with PHP 5+ in general. I'm sure thats been resolved by now, but you may need to update to a newer version.

Posted: Sat Mar 17, 2007 12:47 pm
by jmackenz
Is there a way to upgrade the entire application repository entry of oscommerce, rather than just updating on a per domain basis?

Posted: Sat Mar 17, 2007 1:01 pm
by jmackenz
Thanks to scotts comment, I went searching for oscommerce php 5 on google and found this :

http://forums.oscommerce.com/lofiversio ... 77004.html
1: Change in php.ini
register_globals = On
register_long_arrays = On

2: Change in catalog/admin/includes/classes/upload.php
on line 31 change

$this = null;

to

//$this = null;
Did this, restared httpd , works great.[/url]

Posted: Sat Mar 17, 2007 1:41 pm
by jmackenz
also found out about a bug with mysql > 4.1 .

http://www.unitedforums.co.uk/vb/archiv ... -7424.html has a quick change that fixes it.

Posted: Mon Mar 19, 2007 7:49 am
by breun
It looks like you need to add /usr/share/pear to your open_basedir path.

Posted: Mon Mar 19, 2007 8:41 am
by jmackenz
Had already tried that through the vhost httpd.conf , hadn't helped, the above steps took care of it though.

Re: OSCOMMERCE error

Posted: Mon Jul 20, 2009 11:29 am
by coolemail
Hi All,

I have a customer who is having difficulty in uploading files to a test domain, before migrating it across.

The errors they are getting are:
[Mon Jul 20 10:27:03 2009] [error] [client 88.174.12.194] PHP Warning: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/home/httpd/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputExtra.php) is not within the allowed path(s): (/var/www/vhosts/domain.com/subdomains/test/httpdocs:/tmp) in /var/www/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputData.php on line 2657

[Mon Jul 20 10:28:15 2009] [error] [client 88.174.12.194] PHP Warning: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/home/httpd/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputExtra.php) is not within the allowed path(s): (/var/www/vhosts/domain.com/subdomains/test/httpdocs:/tmp) in /var/www/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputData.php on line 2657, referer: http://test.domain.com/

[Mon Jul 20 10:28:16 2009] [error] [client 88.174.12.194] File does not exist: /var/www/vhosts/domain.com/subdomains/test/httpdocs/shopimages/products/thumbnails/dvd.thumb.jpg, referer: http://test.domain.com/section.php?xSec=40

[Mon Jul 20 10:29:41 2009] [error] [client 88.174.12.194] PHP Warning: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/home/httpd/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputExtra.php) is not within the allowed path(s): (/var/www/vhosts/domain.com/subdomains/test/httpdocs:/tmp) in /var/www/vhosts/domain.com/subdomains/test/httpdocs/routines/cartOutputData.php on line 2657, referer: http://test.domain.com/section.php?xSec=40
I was going to make the changes suggested by jmackenz above (thank you for the comprehensive follow-up with help on what sorted it for you). But the dates of this thread, and the associated links, are really old, and I'm not sure if this would be best practice now.

If they upload via the website, it fails. If they upload via ftp, it works fine. Interestingly, when I upload an item via the website, it works fine.

I'm not sure what they might be trying to do which is causing the errors above.

Does someone have advice on whether I want to change the php.ini file to the settings suggested, despite this being an old thread?

Can anyone advise, please?

Re: OSCOMMERCE after ART updates

Posted: Tue Jul 21, 2009 8:21 am
by Highland
I wouldn't edit php.ini, as this is global to everyone. But you can create a conf/vhost.conf file to make the changes. open_basedir is inherently restrictive so you can expand it or disable it on a per-domain basis.

Re: OSCOMMERCE after ART updates

Posted: Tue Jul 21, 2009 10:51 am
by coolemail
Thank you Highland for that help. I was not aware I could do that on a per-domain basis.