Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Server Upgrade To Php5 - Now Register_globals Problem


Almirena

Recommended Posts

Posted

Hello.

 

I cannot access my admin section now, with PHP5 installed on the server where my site is. I have gone through the changes shown here , but the problem is still the same.

 

I have changed register_globals = On to register_globals = Off in the file php.ini

 

I'm frankly at a loss. What can I do?

 

My site is here.

Posted

Just to explain...

 

That is, I receive the message

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

 

None of the threads through which I've searched seem to have addressed this problem AFTER php.ini, .htaccess and the patch problems were dealt with. My apologies if I'm re-treading old ground.

Posted
I have changed register_globals = On to register_globals = Off in the file php.ini

 

Did you mean to say that you had turned Register Globals 'On' in php.ini? Because if your quoted text is correct then that's the reason you have this problem.

 

Vger

Posted

No - the text in that php.ini file WAS register_globals = On - but I changed it to register_globals = Off.

 

I wish it WERE as simple as that! But sadly, no... and at this point, my host is kindly going to move the account to a server that still has PHP4.x on it so that I can access the admin again. But I cannot help feeling that is not a satisfactory solution. It's not safe, for one thing.

 

If anyone has a solution, please let me know.

Posted
No - the text in that php.ini file WAS register_globals = On - but I changed it to register_globals = Off.

 

I wish it WERE as simple as that! But sadly, no... and at this point, my host is kindly going to move the account to a server that still has PHP4.x on it so that I can access the admin again. But I cannot help feeling that is not a satisfactory solution. It's not safe, for one thing.

 

If anyone has a solution, please let me know.

 

Ok in your php.ini try setting your "register_globals" back to on!

 

Then in your root directory of the shop change your .htaccess, backup your .htaccess first, search for:

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

 

And change it to something like this:

<IfModule mod_php5.c>
#  php_value session.use_trans_sid 0
#  php_value magic_quotes_gpc 0
 php_value register_globals 0
</IfModule>

 

This will leave your register globals on for apache but will turn them off for your osC install! Hope that helps...

 

Grtz,

 

Arjan Gelderblom

I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image.

-- Stephen Hawking

Posted
Just to explain...

 

That is, I receive the message

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

 

None of the threads through which I've searched seem to have addressed this problem AFTER php.ini, .htaccess and the patch problems were dealt with. My apologies if I'm re-treading old ground.

well you see... if you receive that message it means you did not install the register globals module as you claimed...

Posted

Unless you can think of a way in which my manual edits wafted off into the ether rather than be uploaded and take effect, I did indeed do the patching of each file listed in the module. I've checked twice. I don't mind checking again, but this is what I did:

 

Register Globals v1.5 (w/ bugfix 2) - Patch Files Only - I uploaded the patch files. I set register_globals to off. I checked .htaccess. I still could not access my admin. So I checked VV 1.5 - ZIP Archive to see if I'd missed anything. I went through the files manually. There did not appear to be a problem.

 

Still could not access my admin.

 

If I've made an error, I don't see where. I'll be truly grateful if you can point out where such an error could have occurred.

Posted

My server had the same error, and I solved it by editing my .htaccess file.

 

open your .htaccess file and add the following line of code to it.

 

put this line in it.

 

php_flag register_globals on

 

afterwards make sure to set the ownership to the username of the domain.

 

chown username:username .htaccess

 

You should do all this via SSH.

 

Hope this helps

Posted
Unless you can think of a way in which my manual edits wafted off into the ether rather than be uploaded and take effect, I did indeed do the patching of each file listed in the module. I've checked twice. I don't mind checking again, but this is what I did:

 

Register Globals v1.5 (w/ bugfix 2) - Patch Files Only - I uploaded the patch files. I set register_globals to off. I checked .htaccess. I still could not access my admin. So I checked VV 1.5 - ZIP Archive to see if I'd missed anything. I went through the files manually. There did not appear to be a problem.

 

Still could not access my admin.

 

If I've made an error, I don't see where. I'll be truly grateful if you can point out where such an error could have occurred.

 

well here is what I am saying: If you used the register globals module, in application_top.php it comments out the code that shows the error message you posted.

 

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
// >>> BEGIN REGISTER_GLOBALS
//  if (function_exists('ini_get')) {
//	ini_get('register_globals') or exit('Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.');
//  }
// <<< END REGISTER_GLOBALS

So if you used it you would never see the error. But you posted that you still seeing the error now isn't it?

Posted

I had edited .htaccess already... I'll re-check it.

 

Enigma, the error message to which you point is not the same as the error message which I receive. If you check my first post, you'll see the exact message that appears when I try to access my admin, and clearly it's not the same error message as is edited out in application_top.php. Similar, but not the same.

Posted
I had edited .htaccess already... I'll re-check it.

 

Enigma, the error message to which you point is not the same as the error message which I receive. If you check my first post, you'll see the exact message that appears when I try to access my admin, and clearly it's not the same error message as is edited out in application_top.php. Similar, but not the same.

of course because there is another application_top.php on the admin end which also you did not modify.

 

If you don't want to follow the installation instructions you going to stay with the problem. It's simple as that. And it's fine with me too. Keep changing the .htaccess

Posted
of course because there is another application_top.php on the admin end which also you did not modify.

 

If you don't want to follow the installation instructions you going to stay with the problem. It's simple as that. And it's fine with me too. Keep changing the .htaccess

 

Er... I'm not sure what you're getting at. I thought I'd already stated that I had followed the installation instructions. It really isn't a case of my refusing to follow them! To reiterate: I've followed the installation instructions. I edited each of the files mentioned.

 

The application_top.php in admin also does not have the error message which I receive. The error message (which IS edited out and has been from the time when I first edited these files as per the instructions) would be this:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

The error message I receive is:

 

FATAL ERROR: register_globals is disabled in php.ini, please enable it!
Posted
Er... I'm not sure what you're getting at. I thought I'd already stated that I had followed the installation instructions. It really isn't a case of my refusing to follow them! To reiterate: I've followed the installation instructions. I edited each of the files mentioned.

 

The application_top.php in admin also does not have the error message which I receive. The error message (which IS edited out and has been from the time when I first edited these files as per the instructions) would be this:

The error message I receive is:

Ok, I see. I checked the stock osc files, the message you mentioned may only come from an installation file. Do not use the install osc automatic process. Do the following:

 

1. Extract the osc files into your local pc (http://www.oscommerce.com/solutions/downloads)

2. Apply the register globals contribution. (http://www.oscommerce.com/community/contributions,2097)

3. Edit the 2 configure.php files (catalog\includes\configure.php and catalog\admin\includes\configure.php) to reflect your server's settings and dbase.

4. Connect with an FTP tool to the server and upload all files. (minus the install and extra folders you don't need them)

5. Password protect the admin folder.

 

Then the osc and should come up ok with php5/mysql5 etc. and the register globals will be off.

Posted

and you need to create the database if you don't have it. Use phpmyadmin from your host cpanel. Create the dbase and load the oscommerce.sql file from the archive. From that process you will have the dbase, username and password you need to set for your configure.php files.

Posted

Oh, I probably haven't been clear enough. This is for an installed OSCommerce which hasn't had any problems for over two years. I moved from one hosting company to another without any issues at all - very easy with cPanel, of course! And on the new account, all worked perfectly. The problem only came in the last week and a half. This is because just recently (roughly a week and a half ago), the servers on which my accounts are were upgraded to PHP5.x, and that's when this problem started. It isn't on my local computer and the databases have been created long since.

 

My host is going to take a look at the problem today, so we may work out what the problem is. But clearly it's something to do with PHP5, upgraded from PHP4.

 

It'll be interesting when OSCommerce is released in version 3 - I think most (probably all) of these problems will not be encountered anymore. But in the meantime of course... I have to be able to access my admin. I'm just glad I receive copies of all orders to my own email address, so that I'm not leaving customers hanging while we work out what this problem is! But I can't add new concert information or new CD information, which is a pain...

Posted

copy the files from the server to your local PC. Then perform a text search in the files for that error message. See which file has it.

Posted

Almirena,

I received the same error after an upgrade from PHP 4 to PHP 5. The error message is misleading. The problem is the php 5 modules were not loaded properly on the apache web server. At least that was the case with me. The following was the solution that worked for me:

 

1) In PHP.ini make sure register_globals = on

open: /etc/httpd/conf/httpd.conf

*note - that is the location on my distro of linux (Fedora 7) - httpd.conf maybe located elsewhere on your server.

2) add the following lines:

LoadModule php5_module modules/libphp5.so

AddHandler php5-script php

# Add index.php to your DirectoryIndex line:

DirectoryIndex index.html index.php

AddType text/html php

# PHP Syntax Coloring

# (optional but useful for reading PHP source for debugging):

AddType application/x-httpd-php-source phps

 

Once I restarted the apache it began to work. I hope that helps.

Posted

Thank you very much indeed - the problem is solved by that method. I can finally access my admin again and all seems to be working smoothly.

 

Phew! What a relief. Thank you to everyone who replied here - I truly appreciate it.

Posted

The real problem is that OSCommerce relies on register_globals at all. This is a well known and well-documented security risk in PHP.

 

When are we going to see a version of the package that does not rely on this long standing security risk/flaw in PHP?

Posted
The real problem is that OSCommerce relies on register_globals at all. This is a well known and well-documented security risk in PHP.

 

When are we going to see a version of the package that does not rely on this long standing security risk/flaw in PHP?

Paul, osCommerce is a work in progress. I suggest you read the following blog from the osC Project Team Leader:

http://blogs.oscommerce.com/2007/04/25/his...-oscommerce-22/

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Archived

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

×
×
  • Create New...