Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Installation with PHP 5


t-t

Recommended Posts

Posted

I am busy finding my way through an installation of oscommerce on my Fedora

Core 4 linux system - which has PHP 5, I have run into a couple of snags and issues,

but you can find the play by play at:

 

http://cholla.mmto.org/computers/oscommerce.html

 

I am learning as I go, in particular I have had to enable register_globals as well

as register_long_arrays in my php.ini file to make things work. It still isn't up yet,

and in fact at this point the admin page just gives me a blank screen, heaven

only knows why, but if anyone cares to take a look at what I am doing and give

me tips, please do. And perhaps this may help the next guy who stumbles down

this road.

 

AND, I just have to ask. Have all the oscommerce developers gone on to other

efforts - the milestone 2 I downloaded was from back in 2003, is anyone going to

clean up the register_globals issue, or should I find a developer forum to ask these

kinds of questions?

Posted

For the admin page blank screen, take a look at the "$this in uploads.php" link below my name. That's another php5 problem. If you are using the updated version of MS2 from November of last year the php5 and MySQL 5 issues are corrected in that updated file set. There are also essential security fixes included.

 

As you are using an Apache server you did not need to apply the Register Globals Patch Files (Vger is "she" by the way and not "he"). You could just have put this code in a root level .htaccess file:

 

php_flag register_globals on

 

Over time some developers leave, and others join. Yes, there is ongoing work on developing osCommerce.

 

Vger

Posted

My sincere apology about the "he" thing.

 

You are my hero in any event, I am just finishing putting in the register globals patch

you assembled and have added that to my set of notes, also getting ready to do a global

eradication of HTTP_GET_VARS, replacing them with _GET (and _POST as needed).

 

I thought there was a way to do a local turning on of register_globals, so thanks for

cluing me in to the Apache trick, it may come in useful. I will look into your cure for

the blank admin page, and my online notes keep growing, maybe this will actually

work for me eventually.

 

Glad to hear there is still oscommerce development going on. You mention there is

a November update I should have gotten - Did I miss something on the oscommerce

downloads page, or is there a better source for more recent work?

Posted

osCommerce 2.2 Milestone 2 Update 051113

 

That's the one that's been on the downloads page since last November. It includes a whole raft of bug fixes (php and MySQL 5 and other things), plus essential security patches.

 

Vger

Posted

Well slap me in the head with a brick! I go back to the oscommerce site and

what do I find but oscommerce-2.2ms2-051113.tgz just as you say. I don't know

how and where I got my hands on this oscommerce-2.2ms2.tar.gz yesterday, but now

I guess the thing for sure is to start this business all over. Thanks a lot!

 

I'm the better person now for all the PHP troubleshooting experience though!!

Posted

Ive had OSC installed before and am coming back to it after a while, Im installing the most recent "osCommerce 2.2 Milestone 2 Update 051113"

 

Im also running PHP 5 and MySQL 5 with Apache 1.3 on Win2K

 

When I try to start the installation, i get

"FATAL ERROR: register_globals is disabled in php.ini, please enable it!"

 

What am I missing ? Im really not fond of enabling globals

Posted

I completely new to OsCommerce, for which I'm trying to install the "osCommerce 2.2 Milestone 2 Update 051113" onto :

 

Win2000 + Apache 2.0.55 + PHP 5.1.2 + MySQL 5.0.18

 

First I got the "FATAL ERROR: register_globals is disabled in php.ini, please enable it!" which I enabled and is solved now.

 

Pointing my browser to http://yourserver/catalog/install/ doesn't work.

I have to use http://yourserver/catalog/install/install.php

 

On the first screen I click continue, which returns me the same screen over and over and over again. An enless loop

 

What might be the reason for that ?

 

Thanks

Posted

I just installed Vgers patch for the "register globals" issue. Seems to fix my problem, and I didnt have to turn on register globals and got all the way through the installation.

 

So why isnt this patch included applied to the version that is avaiible for download ?

Posted

Maybe it's important :

 

Having installed the "osCommerce 2.2 Milestone 2 Update 051113"

 

The New Installation screen says "Copyright 2003 oscommerce" In the documenatation is see 2004 specified.

Posted
..."osCommerce 2.2 Milestone 2 Update 051113"

If you are using the latest version of MS 2.2, and you want to use the Register Globals patch, you may be interested in the Register Globals patch update I posted up the other day - V 1.4. The previous version (1.3) will remove one of the fixes that the new MS 2.2 adds to the session management.

 

Rich.

Posted

I tried the I Vgers patch for the "register globals" issue and turned the setting in the php.ini back to off.

 

No luck, the php.ini setting On seems to be mandatory on my system.

 

I tried to have the .htaccess on different locations

Posted
...No luck, the php.ini setting On seems to be mandatory on my system....

In that case, you have probably got more than one php.ini file lying about and your web server is not using the one you think it is.... it happens a lot!

 

Rich.

Posted
In that case, you have probably got more than one php.ini file lying about and your web server is not using the one you think it is....

 

I'm sure because .... when I change the setting from Off to On, the error is gone. Must be the correct php.ini.

 

But what worries me even more is the endless loop I mentionned earlier.

(I had to post several replies as it seems I can't -not authorised- to edit my own posts in this forum once the post is submitted)

Posted
I'm sure because .... when I change the setting from Off to On, the error is gone. Must be the correct php.ini.

...but you said...

No luck, the php.ini setting On seems to be mandatory on my system.

This suggested (to me) that changing your settings in php.ini had no affect.

 

I'm all confused now...

 

Rich.

Posted
...but you said...

 

This suggested (to me) that changing your settings in php.ini had no affect.

 

I'm all confused now...

 

Rich.

 

Sorry for that <_<

 

Let's resume :

- I had the global setting off in php.ini --> register globals error

- I turned global setting on --> no error, but endless loop

- I turned global setting off and added php_flag to .htaccess (I tried the one is catalog and tried also with one I created in htdocs) --> error

- Turned global setting on again --> no error, but endless loop

 

I assume the patch is only the php_flag ?

 

Leaves me with the following :

 

- why The New Installation screen says "Copyright 2003 oscommerce" In the documentation I see 2004 specified. I downloaded oscommerce-2.2ms2-051113.zip today

- why hitting Continue on the New Installation screen gets me into an endless loop of this screen

 

Thanks !!

Posted

The following solution worked for me with register_globals.

create a new text file with the single line of

 

register_globals = On

 

save it as php.ini and upload it to the folders that need it. I have placed a copy under my webroot, and also added it to the catalog, admin and the install folders. After this everything worked "by the book".

To verify the result I have also created a test.php file with

 

<? phpinfo(); ?>

 

in it and loaded it to the same folders. You can run these test.php files from your browser to see the condition of register_globals.

Enjoy!

Posted
...I assume the patch is only the php_flag ?...

No it is not. It modifies the osc code so that it will work in a "register globals off" environment.

 

- why The New Installation screen says "Copyright 2003 oscommerce" In the documentation I see 2004

specified. I downloaded oscommerce-2.2ms2-051113.zip today

Does it matter?

 

Ok, copyright dates do not move with the times. Just because a new version has been released (eg - November 2005), does not mean the copyright date moves with it. The copyright date is fom the time osc was first released (which was actually 2002 I think, but ha-ho).

 

- why hitting Continue on the New Installation screen gets me into an endless loop of this screen

Firstly, this has nothing to do with register globals. All that is happening is that having register globals set in whatever way you need to make the code run is enabling the code to run.

 

Why, once the code is running, you end up with the same page being returned multiple times, I'm not sure. It sounds like you have a http redirect being hit and it is redirecting back to itself, or the redirect in ping-ponging between 2 or more pages. This usuallly has a limit on it though to stop such an endless loop. Clearly this is not the case though. I would look at the apache logs and see what requests are bing made. If you see lots of redirects (can't remember the code off the top of my head - 302? No - I don't think that's right) then there's the problem and you need to locate what's doing it (but you knew that already!).

 

Rich

Posted
Nice to see you back on the forums Richard!

 

Vger

My girlfriend was out for the day and I'd finished cleaning the house :-)

 

Rich.

Posted

OK, sorry to not be back sooner, but the endless loop on install thing can

be fixed as follows: Add the following line to your php.ini and restart apache:

 

register_long_arrays = On

 

The root cause is that oscommerce uses HTTP_GET_VARS and HTTP_POST_VARS

which is not just deprecated, but deactivated in PHP 5, It has been deprecated a long time.

 

You may be able to do this just for oscommerce via:

 

php_flag_register_long_arrays on

 

in a .htaccess file, but I haven't tried this.

 

Now the REAL question is why oscommerce is getting released with this and a myriad of other

blemishes that people keep stumbling over (and why the register globals patch has not found its

way into the main release). I suppose I should wander over to the developer part of the forum

and try to find out. I am thinking of just patching up my own php 5 friendly oscommerce and

keeping it on my own website (which I am not allowed to mention, OK, I didn't say that, I don't really

have a website with oscommerce information and patches.... B) ) If I do I will just do a global change

from HTTP_GET_VARS to _GET which will fix this business and do no harm.

Posted

I've searched the forums and cannot seem to find the answer to this one, can anyone give me a steer in the right direction ?

 

Over the past couple of weeks I've installed (many times) the November release - 2.2 MS2 (051113). And as my host has "globals off" I have also installed Vger's Register Globals Patch Files and everything seems to work fine.

 

However, when I go into Admin screen and select Catalog, then Categories/Products and drill down into Hardware > Graphics Cards and then select the Matrox G200MMS to "edit" and try to preview, I get the following error message:

 

Fatal error: Call to a member function set_file() on a non-object in xxxxxxxxxxxxxxcatalog/admin/includes/classes/upload.php on line 17

 

The start of the upload.php file is as follows:

 

<?php

/*

$Id: upload.php,v 1.2 2003/06/20 00:18:30 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class upload {

var $file, $filename, $destination, $permissions, $extensions, $tmp_filename, $message_location;

 

function upload($file = '', $destination = '', $permissions = '755', $extensions = '') {

$thisMat->set_file($file);

$thisMat->set_destination($destination);

$thisMat->set_permissions($permissions);

$thisMat->set_extensions($extensions);

 

 

 

Have I missed a trick somewhere ?

 

I've resisted asking for help for as long as possible but cannot seem to find a way out of this on the forum for myself ..........

Posted
Does it matter?

 

Ok, copyright dates do not move with the times. Just because a new version has been released (eg - November 2005), does not mean the copyright date moves with it. The copyright date is fom the time osc was first released (which was actually 2002 I think, but ha-ho).

 

I don't know if it matters, as I'm not the developer. I might be an oscommerce n00b, but not an ICT-n00b : I made the assumption parts of the distro might be old (and generating problems) as the screenshots in the documentation show a more recent date. Just can't imagine this kind of stuff is changed just for documentation-purposes. :-"

Posted
Add the following line to your php.ini and restart apache:

 

register_long_arrays = On

 

The root cause is that oscommerce uses HTTP_GET_VARS and HTTP_POST_VARS

which is not just deprecated, but deactivated in PHP 5, It has been deprecated a long time.

 

Great, thanks, this works !!

 

You may be able to do this just for oscommerce via:

 

php_flag_register_long_arrays on

 

in a .htaccess file, but I haven't tried this.

 

I tried both

- php_flag_register_long_arrays on

- php_flag register_long_arrays on

in the .htaccess located in the oscommerce-root without luck.

This is a pitty because I don't like the idea having to change the php.ini. As now I'm evaluating oscommerce on my own system. When third-party hosting is done, things are different.

 

If someone has an idea to get around this, I would be glad to hear about it !

 

Now the REAL question is why oscommerce is getting released with this and a myriad of other

blemishes that people keep stumbling over (and why the register globals patch has not found its

way into the main release). I suppose I should wander over to the developer part of the forum

and try to find out. I am thinking of just patching up my own php 5 friendly oscommerce and

keeping it on my own website (which I am not allowed to mention, OK, I didn't say that, I don't really

have a website with oscommerce information and patches.... cool.gif ) If I do I will just do a global change

from HTTP_GET_VARS to _GET which will fix this business and do no harm.

 

Fully agree. The installation should work without having to tweak all kind of settings, because PHP/MySQL have evolved. I really think this harms quality-perception of oscommerce.

 

Why not making an official intermediate maintenance-release with patches like the VGER one. If somehow one is made inofficially, please PM me the url ;)

 

Thanks to all those who helped me getting it installed. Now I can start playing around !

Posted

Perserverence found the excellent contribution from Richard Bentley (et al) that solved my problem

in post#21.

 

It's an excellent contribution with clear instructions and a thorough explanation of the issues.

(Definitely relevant if you are going to add more contributions....)

 

You can find it here:

 

http://www.oscommerce.com/community/contributions,2097/

 

Many thanks to Richard and the team.

 

:D

Archived

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

×
×
  • Create New...