Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP5 upgrade fixes


gottaloveit

Recommended Posts

Posted

I hav FreeBSD 5.3, Apache 2.0.54, PHP 5.0.5 with Zend Engine 2.0.5, MySQL 4.1.14.

 

Here is what I did to make BOTH the CATALOG and ADMIN function....

 

in PHP.INI

zend.ze1_compatibility_mode = On

register_globals = Off

register_long_arrays = Off

session.auto_start = 1

 

the default php.ini for PHP5 is:

zend.ze1_compatibility_mode = Off

register_globals = Off

register_long_arrays = Off

session.auto_start = 1

 

Next, in in HTTPD.CONF for the server or virtual host or directory that defines your catalog site, make sure to set

AllowOverride

to any of the following combinations:

AllowOverride All

AllowOverride Options

AllowOverride AuthConfig Options

(if you want for some reason there to be HTTP user and password to access site)

AllowOverride AuthConfig All

(if you want for some reason there to be HTTP user and password to access site)

 

Next, in your .htaccess file for your catalog directory:

php_value session.auto_start off

php_value register_long_arrays on

php_value register_globals on

 

(you do not need to replicate for admin directory IF the admin directory is directly under catalog. If you have moved the admin outside of the catalog directory, then make a .htaccess file for admin with the same information)

 

Next, make the following changes:

/catalog/includes/application_top.php around line 300, change the if PHP version line

// navigation history
 if (tep_session_is_registered('navigation')) {
 if (PHP_VERSION < 4 || PHP_VERSION >= 5) {

 

/admin/includes/classes/upload.php around line 31, after the self destruct line and before the return false line, comment out the $this->null so it looks like:

// self destruct
//          $this = null;

         return false;
       }

 

That should be it .. That is all the changes I made. Of course, RESTART APACHE since you made changes to php.ini and httpd.conf. It should work.

 

The above changes work on 3 completely different osCommerce sites that I am hosting so I know the solution works for my situation, so please don't tell me it does not work.

 

Thanks && Good Luck.

Posted

I have Fedora Core 4, Apache 2.0.54, PHP 5.0.4 with Zend Engine 2.0.4, MySQL 4.1.12. (all running on an old Pentium box)

 

After fighting with SELinux and getting my Apache sites running properly, your instructions were Perfect. Thank you over and over for posting and for the lucid directions.

 

Loon

  • 2 months later...
Posted

Thank you!

Olivier

interfaSys s?rl

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

You'll love to use our solutions!

Rich Internet Applications and Usability

  • 5 months later...
Posted

Hi there, I have been going nuts trying to fix this cart, it was live when we did the switch, now it has been down for 2 days. I hope your post is my saviour.

 

Where do i find

PHP.INI

HTTPD.CONF

 

:(

  • 4 months later...
Posted

Where do i find PHP.INI HTTPD.CONF ?? I would also like to know. Although I'm not sure if my situation quite fits in this section. Our servers were hacked into and brought our site down, as a result we upgraded software and uploaded our backups, but now when I access the Admin part of our site I can't go to anything or do anything, it seems as though those links are invalid. If I upgrade OScommerce will this fix the problem?

Posted
Where do i find PHP.INI HTTPD.CONF ??

 

it depends on the operatiing system of the server and if any customization was done on the install. best check with your server provider for these files. sometimes you cannot change them without getting help from your host.

 

I would also like to know. Although I'm not sure if my situation quite fits in this section. Our servers were hacked into and brought our site down, as a result we upgraded software and uploaded our backups, but now when I access the Admin part of our site I can't go to anything or do anything, it seems as though those links are invalid. If I upgrade OScommerce will this fix the problem?

 

as far as i know there is not a clean "php5" approved osCommerce version. if you upgraded your server, and went to PHP5, you probably will have problems and the fixes I described should work for you.

Posted

Gottaloveit, thank you so much for help/Post. I was about to throw everything out the window before I came accross your helpful post. :D

loganmas

  • 5 months later...
Posted

Thank you very much for the detailed update information. It was the answer to my problem.

 

Thanks again!

  • 4 weeks later...
Posted

Hi all,

As I am not an expert, I would like to know how to make the below changes in HTTPD.CONF

 

Thanks

 

Salvo

 

PS: I have just upgrated to php5, it FATAL ERROR: register_globals is disabled in php.ini, please enable it! is there an easy way?

 

 

 

 

I hav FreeBSD 5.3, Apache 2.0.54, PHP 5.0.5 with Zend Engine 2.0.5, MySQL 4.1.14.

 

Here is what I did to make BOTH the CATALOG and ADMIN function....

 

in PHP.INI

zend.ze1_compatibility_mode = On

register_globals = Off

register_long_arrays = Off

session.auto_start = 1

 

the default php.ini for PHP5 is:

zend.ze1_compatibility_mode = Off

register_globals = Off

register_long_arrays = Off

session.auto_start = 1

 

Next, in in HTTPD.CONF for the server or virtual host or directory that defines your catalog site, make sure to set

AllowOverride

to any of the following combinations:

AllowOverride All

AllowOverride Options

AllowOverride AuthConfig Options

(if you want for some reason there to be HTTP user and password to access site)

AllowOverride AuthConfig All

(if you want for some reason there to be HTTP user and password to access site)

 

Next, in your .htaccess file for your catalog directory:

php_value session.auto_start off

php_value register_long_arrays on

php_value register_globals on

 

(you do not need to replicate for admin directory IF the admin directory is directly under catalog. If you have moved the admin outside of the catalog directory, then make a .htaccess file for admin with the same information)

 

Next, make the following changes:

/catalog/includes/application_top.php around line 300, change the if PHP version line

// navigation history
 if (tep_session_is_registered('navigation')) {
 if (PHP_VERSION < 4 || PHP_VERSION >= 5) {

 

/admin/includes/classes/upload.php around line 31, after the self destruct line and before the return false line, comment out the $this->null so it looks like:

// self destruct
//          $this = null;

         return false;
       }

 

That should be it .. That is all the changes I made. Of course, RESTART APACHE since you made changes to php.ini and httpd.conf. It should work.

 

The above changes work on 3 completely different osCommerce sites that I am hosting so I know the solution works for my situation, so please don't tell me it does not work.

 

Thanks && Good Luck.

Posted
Hi all,

As I am not an expert, I would like to know how to make the below changes in HTTPD.CONF

 

Thanks

 

Salvo

 

PS: I have just upgrated to php5, it FATAL ERROR: register_globals is disabled in php.ini, please enable it! is there an easy way?

Install the register globals module.

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

  • 2 years later...
Posted

Joe,

 

Thanks for your post. My website is highly customized and I applied the changes suggested by your initial post and my test-site works! I also had to apply register_globals contribution prior to applying your fix.

 

Thanks again!

Archived

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

×
×
  • Create New...