Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Archived

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

peterr

Will osCommerce work 100% with PHP5 ?

Recommended Posts

Hi,

 

As the subject states, will osCommerce work (100%) with PHP version 5 ?

 

There is to be a sever upgrade in a few weeks, so I'd rather know about about problems with "osC + PHP5" sooner rahter than later. :D

 

Any issues to do with backwards compatibility problems, such as outlined here:

 

http://www.php.net/manual/en/migration5.incompatible.php

 

I'm supporting two osCommerce production sites, and about to load a third one soon on the same server, so I'd appreciate it if either Harold or one of the developers could give me some sort of assurances please.

 

I'm no PHP guru, can 'fumble' my way through the code, so as far as me looking through the osC code to check for any "possibile" problems, is completely out of the question.

 

I noticed in this thread:

 

http://forums.oscommerce.com/index.php?act...ndpost&p=369751

 

that a comment was made about osCommerce not having been tested with PHP5 yet, but the comment was made on May 17th. Possibly some testing has been done since ?

 

Btw, I think osCommerce is really great, a recent attempt at hacking the code was fruitless, and the two osC sites are 'nice and 'stable' (... arrrhhhh), well done, development team. :D

 

Thanks, :)

 

Peter

Share this post


Link to post
Share on other sites
Guest

you should check with your host to see if they will disable register_globals or not in 5 . . .

Share this post


Link to post
Share on other sites

Hi John,

 

you should check with your host to see if they will disable register_globals or not in 5 . . .

 

Recently I thought that turning it on was a security risk and in my (naive) understanding of these matters replied to a post about register_globals, see here:

 

http://forums.oscommerce.com/index.php?sho...egister_globals

 

Fortunately, I was corrected by a Team member, and am now a little wiser at least. In the end I didn't change it, and it is set to ON for the osCommerce sites.

 

I did notice just now some code for .htaccess that comes with osCommerce

 

#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>

 

which confirms what I was corrected on in the thread, for PHP (version 4), it's okay to have it set to ON.

 

Now, after all my waffle, back to your recommendation to set it to OFF.

 

Fortunately, I am allowed to use .htaccess to set PHP values ON or OFF, so to your recommendation to set it off for PHP5, no doubt I just add this line to .htaccess

 

php_value register_globals 0

 

this does only set the Local Value to OFF, not the "Master Value", however, having used other PHP settings in .htaccess , only setting it at the local level appears to cause no problems, the effect seems to be more 'global' than local, because the settings work for all the PHP code for osCommerce.

 

Thanks for your help, :)

 

Peter

Share this post


Link to post
Share on other sites

if you turn it off, on eithe 4 ot 5 you will break the store

 

it is no more of a security risk on 5 than it is on 4,

 

and imo the security risk that is does pose is way way way over blown, but that is just me...

 

as far as the osc and php5, there is alot more than just the globals thing to wonder about, and frankly I dont know,.....

 

I have not studied it, too much yet since is was just release yesterday

 

why is your host soo ready to jump to php5, it am sure there are alot of site out there not ready yet

 

hell we are not even considering it yet at this point

Share this post


Link to post
Share on other sites

Hi,

 

if you turn it off,  on either 4 ot 5 you will break the store

 

How will turning it off break the store, I don't understand ? The previous web hosts I was with had it turned off, and osCommerce didn't 'break' ??

 

as far as the osc and php5,  there is alot more than just the globals thing to wonder about,  and frankly I dont know,.....

 

Yes, well, that's what I would like to find out also.

 

Peter

Share this post


Link to post
Share on other sites

osCommerce is not PHP5 compatible. There have been several changes. For one, all $this = null; occurrences need to be changed to unset($this). It also seems to have changed how relative paths work in such a way that a script can be either PHP4 compatible or PHP5 compatible but not both (from looking at a bug report). There are a couple bug reports that have PHP5 compatible coding suggestions.

 

PHP5 only just came out in gamma (Tuesday, 07/13/04 ... or 13/07/04 for the Europeans). Hosts should not be forcing upgrades to it yet. It's barely suitable for optional upgrades.

 

In the bug reports, Mark said that he wasn't going to look at PHP5 compatibility until it came out in gamma. MS2 will not be PHP5 compatible. MS3 will probably be made PHP5 compatible, but they have not guaranteed it yet.

 

I don't think that John was recommending that you turn off register_globals. Instead, I just think that he was saying that if it was turned off, MS2 wouldn't work. MS3 should work with register_globals off anyway, so that shouldn't matter: current snapshots and older won't work with PHP5 without code changes.

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

Hi Matt,

 

osCommerce is not PHP5 compatible.

 

Well, thats at least a definitive answer, thanks.

 

There have been several changes.  For one, all $this = null; occurrences need to be changed to unset($this).

 

I don't know how accurate Windows "find" is on strings with multiple words,etc, but I searched through the osC source for string "$this = null" and only found one occurance, in /catalog/admin/includes/classes/upload.php , and line 31 was the only occurance in _that_ file I could find. I'm sure there would be more ??

 

It also seems to have changed how relative paths work in such a way that a script can be either PHP4 compatible or PHP5 compatible but not both (from looking at a bug report).

 

Not too sure of the impact on osC, although a number of the defines do rely on the constant DIR_WS_INCLUDES , which in itself is defined as a relative path like:

 

 define('DIR_WS_INCLUDES', 'includes/');

 

.. so there is a potential problem, affecting many constants used for (relative) paths.

 

In the bug reports, Mark said that he wasn't going to look at PHP5 compatibility until it came out in gamma.  MS2 will not be PHP5 compatible.  MS3 will probably be made PHP5 compatible, but they have not guaranteed it yet.

 

Oh, well, it seems it will certainly be some time before osC is ready for PHP5 then. The server upgrade is not a forced issue, and won't go ahead if there are any major issues. There are apparently other osCommerce users on the same server, so I think what has been mentioned already would suffice to say that osC MS2 is definitely not PHP5 compatible, although I'm still wanting a reply from an osC team member (developer), to put the final word on this.

 

Only yesterday, there was an upgrade to PHP version 4.3.8, apparently the version we were on (4.3.7) had a security flaw.

 

I don't think that John was recommending that you turn off register_globals.  Instead, I just think that he was saying that if it was turned off, MS2 wouldn't work.

 

We had a number of osCommerce MS2 sites running for 4 or 5 months, with register_globals set to off , and MS2 did work, so I think the statement needs to be clarified a bit, it may even be server specific ??

 

Thanks for your help,

 

Peter

Share this post


Link to post
Share on other sites
Hi Matt,

 

osCommerce is not PHP5 compatible.

 

Well, thats at least a definitive answer, thanks.

 

There have been several changes.  For one, all $this = null; occurrences need to be changed to unset($this).

 

I don't know how accurate Windows "find" is on strings with multiple words,etc, but I searched through the osC source for string "$this = null" and only found one occurance, in /catalog/admin/includes/classes/upload.php , and line 31 was the only occurance in _that_ file I could find. I'm sure there would be more ??

 

It also seems to have changed how relative paths work in such a way that a script can be either PHP4 compatible or PHP5 compatible but not both (from looking at a bug report).

 

Not too sure of the impact on osC, although a number of the defines do rely on the constant DIR_WS_INCLUDES , which in itself is defined as a relative path like:

 

 define('DIR_WS_INCLUDES', 'includes/');

 

.. so there is a potential problem, affecting many constants used for (relative) paths.

 

In the bug reports, Mark said that he wasn't going to look at PHP5 compatibility until it came out in gamma.  MS2 will not be PHP5 compatible.  MS3 will probably be made PHP5 compatible, but they have not guaranteed it yet.

 

Oh, well, it seems it will certainly be some time before osC is ready for PHP5 then. The server upgrade is not a forced issue, and won't go ahead if there are any major issues. There are apparently other osCommerce users on the same server, so I think what has been mentioned already would suffice to say that osC MS2 is definitely not PHP5 compatible, although I'm still wanting a reply from an osC team member (developer), to put the final word on this.

 

Only yesterday, there was an upgrade to PHP version 4.3.8, apparently the version we were on (4.3.7) had a security flaw.

 

I don't think that John was recommending that you turn off register_globals.  Instead, I just think that he was saying that if it was turned off, MS2 wouldn't work.

 

We had a number of osCommerce MS2 sites running for 4 or 5 months, with register_globals set to off , and MS2 did work, so I think the statement needs to be clarified a bit, it may even be server specific ??

 

Thanks for your help,

 

Peter

OSC does not work is Globals are turned off

 

now if you use httaccess command and turn them on locally, like you have suggested, then they ARE turned ON, even if the Server is Set to "off" they are ON for your Area of the server...

Share this post


Link to post
Share on other sites
now if you use httaccess command and turn them on locally

 

We were not allowed to use the "php_flag" and "php_value" in .htaccess, with the previous server.

 

Nice try anyway. :D

 

Peter

Share this post


Link to post
Share on other sites

Hi,

 

The first search for string "$this = null" only resulting in one file found, made me do another search.

 

When I did the "find" again with just string "$this", there were 55 files found, quite a few.

 

Peter

Share this post


Link to post
Share on other sites
now if you use httaccess command and turn them on locally

 

We were not allowed to use the "php_flag" and "php_value" in .htaccess, with the previous server.

 

Nice try anyway. :D

 

Peter

I was not trying

 

Either the Globals were on, or you could not install the cart, there are no other options

Share this post


Link to post
Share on other sites

Hi,

 

Could I have a reply please, from an osCommerce team member (or Harold ?), as to the official osC "statement" on PHP5 and osCommerce.

 

Thanks,

 

Peter

Share this post


Link to post
Share on other sites

I think you should ask your hosting company or systems admin.

 

There is to be a sever upgrade in a few weeks, so I'd rather know about about problems with "osC + PHP5" sooner rahter than later.

 

Q. How many month/years have you tested PHP 4.x on production servers?

 

A. Several years.

 

Q. How many known applications work under PHP 4.x on production servers?

 

A. 1000's.

 

Q. How many month/years have you tested PHP5_RC1 on production servers?

 

A. 2 months :).

 

Q. How many known applications work under PHP5_RC1 on production servers?

 

A. 10.

 

We were not allowed to use the "php_flag" and "php_value" in .htaccess, with the previous server.

 

Q. Why am I not allowed to configure my apache/php server?

 

A. Because.........

 

 

Q. What version of php did register_globals get turned off by default?

 

A. I think arouund php 4.2.x and we currently use 4.3.4.

 

Q. What should I do nextttttttttttttttttt?

Share this post


Link to post
Share on other sites

I just setup a separate PHP 5 web server and am happy to report that osCommerce 2.2 Milestone 3 will be PHP 5 compatible.

 

The only PHP 5 incompatibility issues we discovered with our internal CVS version are:

 

* $this = null; -> unset($this);

* isset($string[strlen+1]) produces a notice message when error reporting is set to E_ALL - we replaced this with substr($string, strlen+1, 1) as that would equal FALSE without producing a notice message.


:heart:, osCommerce

Share this post


Link to post
Share on other sites

Hi Harald,

 

I just setup a separate PHP 5 web server and am happy to report that osCommerce 2.2 Milestone 3 will be PHP 5 compatible.

 

That's great, thanks very much for the news on what is planned for PHP5+ Osc 2.2 MS-3. It would appear the code changes are very minimal. :)

 

Thanks again,

 

Peter

Share this post


Link to post
Share on other sites

Hi,

 

... report that osCommerce 2.2 Milestone 3 will be PHP 5 compatible.

 

I did look in the workboard , announcements and a few other places, but couldn't see a projected date for MS-3.

 

Can anyone enlighten me please ??

 

Peter

Share this post


Link to post
Share on other sites

where abouts would i change:

 

isset($string[strlen+1])

 

with:

 

substr($string, strlen+1, 1)

 

TIA

Share this post


Link to post
Share on other sites

×