Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

php5 upgrade, users and orders not stored propperly


roadkill

Recommended Posts

Posted

hi,

 

I am trying to upgrade php on one of my heavilly modded stores (2.2.-ms2) from php 4.4.3 to php5.2.0

 

Everything seems to work fine, I fixed some merge_array problems but some problems remain.

When creating a new account, the customerinfo does not get stored correctly in the database (mysql5) and when a new order is placed the order is not stored right.

In the admin, the order cannot be found, but in the database the order is stored in table orders, but in order_products, the products have order_id "0".

 

I can't figure out why the data is not stored correctly and why it only does this after switching to php5.2

 

Even stranger is the fact that another of my stores which is on the same server, works fine on php5.2.0 (and mysql5)

 

Is there someone who can point me in the right direction on this?

Posted

$HTTP_POST_VARS, etc. ("long array name" variables) are not defined in PHP 5. That might be causing you problems. osC 2.2 RC2a has a "compatibility layer" to create those missing variables from the modern $_POST, etc. You can either add a similar function, or change the old long array name variables to their modern forms.

 

There are probably some other PHP 5 differences. Certainly, by the time your host upgrades to PHP 5.3, you'll need to deal with the list of "deprecated functions". MySQL 5 needs some patches too, if you get "1054" errors.

Posted

$HTTP_POST_VARS, etc. ("long array name" variables) are not defined in PHP 5. That might be causing you problems. osC 2.2 RC2a has a "compatibility layer" to create those missing variables from the modern $_POST, etc. You can either add a similar function, or change the old long array name variables to their modern forms.

 

There are probably some other PHP 5 differences. Certainly, by the time your host upgrades to PHP 5.3, you'll need to deal with the list of "deprecated functions". MySQL 5 needs some patches too, if you get "1054" errors.

 

Thank you MrPhil, for your reply. Fortunally I own the server and switched long_arrays on in php.ini. Are there still variables to look into in the script? The most important reason to upgrade is to switch to SEO5.

Posted

Have you looked through this

 

HTH

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

There were a number of incompatibilities introduced with PHP 5. Besides the dropping of "long array name" arrays, and turning off register global variables by default, in class member functions $this can no longer be assigned to. You should be getting an error message for that, unless you shut off error messages! You might want to read through http://usphp.com/manual/en/migration5.php to see what the differences are. You might also compare vanilla 2.2 RC2a to vanilla 2.2 MS2, and make the same modifications to your store (at least, the PHP-related ones!). Did you upgrade to MySQL 5 at the same time? It too has some incompatibilities that mean changes are needed in the PHP code to generate SQL queries. Do you still have any PHP settings in your .htaccess file (php_value, php_flag)? It's more of a server level issue, but you might need to move them to php.ini.

Posted

There were a number of incompatibilities introduced with PHP 5. Besides the dropping of "long array name" arrays, and turning off register global variables by default, in class member functions $this can no longer be assigned to. You should be getting an error message for that, unless you shut off error messages! You might want to read through http://usphp.com/manual/en/migration5.php to see what the differences are. You might also compare vanilla 2.2 RC2a to vanilla 2.2 MS2, and make the same modifications to your store (at least, the PHP-related ones!). Did you upgrade to MySQL 5 at the same time? It too has some incompatibilities that mean changes are needed in the PHP code to generate SQL queries. Do you still have any PHP settings in your .htaccess file (php_value, php_flag)? It's more of a server level issue, but you might need to move them to php.ini.

 

I have error reporting on, but except from the long_array ones, none were reported. MySQL was already running on 5.0 and te store is register globals off compatible. Along with various modification I might have already made some php5 improvement ($this is not an issue). I think the main problem lies in the storage of the data in MySQL (order_id in orders_products) and in admin the customers query in customers.php (data is in MySQL, but not displayed correctly). Still it is weird that y other shop which is practicly identical can update to php5 without problems. I don't use .htaccess for php.ini settings, only for mod_rewrite settings.

 

I a afraid I have to review the whole script using geoffreywalton 's linksuggestion (thank you), since a restart with oscommerce V3.0 would be a lot more work...

But if someone has a better idea...

Archived

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

×
×
  • Create New...