Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

register_globals issue


vexxed

Recommended Posts

Posted

I am currently trying to install the application on to my bluehost account, and the error below comes up

 

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

 

 

I have checked the php.ini file and register_globals is enabled....

 

 

is there something I am missing with the config, or do I have to go back yo bluehosts?

 

thanks

Posted
I am currently trying to install the application on to my bluehost account, and the error below comes up

 

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

I have checked the php.ini file and register_globals is enabled....

is there something I am missing with the config, or do I have to go back yo bluehosts?

 

thanks

 

 

Hi

 

i had the same problem yesterday luckily my hosting company sorted it but the advice i was given was;

Look in contributions VGER has a contribution called register globals this i was told works.

Remember back up all files first.

 

jaz

 

 

Hi

 

i had the same problem yesterday luckily my hosting company sorted it but the advice i was given was;

Look in contributions VGER has a contribution called register globals this i was told works.

Remember back up all files first.

 

jaz

 

 

hi

 

here is the link;

 

link

 

hope this helps

 

jaz

Posted

In most cases you can create your own php.ini file and put it in each directory you have .php scripts in.

 

the code I use for this is

 

[PHP]
register_globals="Off"

 

just creat a file called php.ini and drop it in the directories that need it.

 

Re run your check program and you should see it off

 

:)

Phil Townsend

Waterslap Farm, Airth

Falkirk Stirlingshire FK2 8QW

Posted

If you can check the php.ini file then this will be a local php.ini file - because you won't have access to the main one for the server. If that one says Register globals is 'Off' then this can override your local one (this depends on how the server is set up).

 

You can either install the Register Globals Patch Files (link below my name) or, if this is an Apache server you can turn them on via a .htaccess file in the root of your web. The code for this would be:

 

php_flag register_globals on

 

Vger

I am currently trying to install the application on to my bluehost account, and the error below comes up

 

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

I have checked the php.ini file and register_globals is enabled....

is there something I am missing with the config, or do I have to go back yo bluehosts?

 

thanks

Posted

Hi.

Thanks for getting back to me.

I installed the files from the Register Globals Patch last week when nothing worked at all, and everything seemed fine. Now that I've got much completed and I'm checking my files to see how they function, I come across this error after I sign in as a returning customer.

I tried naming a file called "php.ini" with only this code and it didn't help:

 

<?php

register_globals="Off";

?>

 

Did I do it wrong?

I also tried:

 

register_globals="Off"

 

This is my error message:

 

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/cust1/user1146517/html/catalog/includes/functions/sessions.php on line 197

 

I'm on a shared Unix server without the ability to change register globals.

I really don't know all the intricacies of PHP, so I'm learning as I go. Sorry if my questions might seem dumb.

 

Thank you very much.

Bruce

Posted

I use the same host and had the same problem a couple of days ago. I found that the contrib worked but clashed with other contribs I wanted to use.

 

Anyway - you have to copy the php.ini file (that says register_globals = On) to every folder like in catalog/, includes/, admin/ and so on. It worked fine for me then and I was able to remove the register globals off contrib.

Posted

Okay, thanks for responding...

I did that. Adding a php.ini file to those folders with only the following:

 

<?php

register_globals="On";

?>

 

...and the same thing happened again.

 

Any other suggestions?

Thank you,

Bruce

 

 

I use the same host and had the same problem a couple of days ago. I found that the contrib worked but clashed with other contribs I wanted to use.

 

Anyway - you have to copy the php.ini file (that says register_globals = On) to every folder like in catalog/, includes/, admin/ and so on. It worked fine for me then and I was able to remove the register globals off contrib.

Posted

Hi. I still need help in resolving is issue. I'm really struggling with this.

 

I dont have either session.bug_compat_42 or session.bug_compat_warn to in catalog/includes/functions/sessions.php on line 197. This is what I have in sessions.php from line 182 to 201:

 

function tep_session_close() {

// >>> BEGIN REGISTER_GLOBALS

// Work-around to allow disabling of register_gloabls - unmap all defined

// session variables

if (count($_SESSION))

{

$session_keys = array_keys($_SESSION);

foreach($session_keys as $variable)

{

link_session_variable($variable, false);

}

}

// <<< END REGISTER_GLOBALS

 

if (PHP_VERSION >= '4.0.4') {

session_write_close();

} elseif (function_exists('session_close')) {

session_close();

}

}

 

I've tried several things, and nothing worked.

I installed the patch for register_globals after my initial setup following the instructions at the bottom of the Read_Me_First file:

 

"If you have already installed your website

then the install folder and the file within it

should not be uploaded to your website."

 

Please, if you have any more tips or ideas, let me know. This is driving me nuts.

Thank you.

Bruce

 

 

 

Hi.

Thanks for getting back to me.

I installed the files from the Register Globals Patch last week when nothing worked at all, and everything seemed fine. Now that I've got much completed and I'm checking my files to see how they function, I come across this error after I sign in as a returning customer.

I tried naming a file called "php.ini" with only this code and it didn't help:

 

<?php

register_globals="Off";

?>

 

Did I do it wrong?

I also tried:

 

register_globals="Off"

 

This is my error message:

 

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/cust1/user1146517/html/catalog/includes/functions/sessions.php on line 197

 

I'm on a shared Unix server without the ability to change register globals.

I really don't know all the intricacies of PHP, so I'm learning as I go. Sorry if my questions might seem dumb.

 

Thank you very much.

Bruce

Posted

The session bug compatibility warnings are in the php.ini file, and you can comment them out if you have access to a local php.ini file.

 

FTP to your site and go down as far as you can in the folder structure and see if you have a folder called 'etc'. If you do then you may find a local php.ini file in that folder.

 

You comment things out in php.ini by putting a semi-colon at the beginning of that line, as in:

;

 

Vger

Posted

Vger,

Thanks so much.

Problem is that I don't have access to that file, nor do I have access to a folder called ect.

Can I give you my FTP info in a personal message and you take a look? I'm at that point...

Thanks again,

Bruce

 

 

The session bug compatibility warnings are in the php.ini file, and you can comment them out if you have access to a local php.ini file.

 

FTP to your site and go down as far as you can in the folder structure and see if you have a folder called 'etc'. If you do then you may find a local php.ini file in that folder.

 

;

 

Vger

Posted

This may be a solutions for you. I had the same problem with the register-global issue.

 

Turn on register globals for a specific domain:

 

- Edit the .htaccess file located in your /httdocs folder

add the following to the end of the file:

 

php_value register_globals 1

Posted

Hi. Thanks for helping me.

I don't know muh about .htaccess other than what I've just read on the the net. OsCommerce has an .htaccess file in the catalog folder. Although it's commented out, it appears to me that it already ends with php_value register_globals 1 is already at the end:

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $

#

# This is used with Apache WebServers

#

# For this to work, you must include the parameter 'Options' to

# the AllowOverride configuration

#

# Example:

#

# <Directory "/usr/local/apache/htdocs">

# AllowOverride Options

# </Directory>

#

# 'All' with also work. (This configuration is in the

# apache/conf/httpd.conf file)

 

# The following makes adjustments to the SSL protocol for Internet

# Explorer browsers

 

<IfModule mod_setenvif.c>

<IfDefine SSL>

SetEnvIf User-Agent ".*MSIE.*" \

nokeepalive ssl-unclean-shutdown \

downgrade-1.0 force-response-1.0

</IfDefine>

</IfModule>

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

 

#<IfModule mod_php4.c>

# php_value session.use_trans_sid 0

# php_value register_globals 1

#</IfModule>

 

So do I just take out the comments from the last four lines and re-install the file?

If yes, does it go in the catalog folder or my html folder (root)?

Also, do I take out the comments from any other lines?

Should I remove any lines?

 

This file also came up in Notepad as a single line file (all text on one line with word-wrap diabled). Do I leave it that way, but remove the small upright rectangular looking characters within it?

 

Thanks again,

Bruce

 

 

This may be a solutions for you. I had the same problem with the register-global issue.

 

Turn on register globals for a specific domain:

 

- Edit the .htaccess file located in your /httdocs folder

add the following to the end of the file:

 

php_value register_globals 1

Posted

Download and install a programme called Textpad (it's a free download) and then open the .htaccess file in Textpad. The text should now display properly.

 

To turn on Register Globals via .htaccess you need to use this code:

 

php_flag register_globals on

 

The code in the old osCommerce .htaccess files probably won't do it for you. Place it in your 'catalog' folder.

 

The problem is that if you have installed the Register Globals Patch then Register Globals do need to be 'off', and this shouldn't affect the bug compatibility warnings anyway. I think that two issues are getting confused here - Register Globals and Bug Compatibility warnings in php.ini.

 

Vger

Posted

Hi Bruce

 

Try editing the file in a program such as Dreamweaver then it will show up correctly. it is best to place that file in the root folder of your domain (the httpdocs) folder because then it will apply to the entire domain. On the other hand, if you have setup oscommerce as suggested then all the subdirectories that require the register_globals to be turned on will be below the catalog directory.

 

I am not sure how much access you have to your actual webspace, the .htaccess file is usually hidden from most ftp means of access, but it is preferable to simply add that line to the .htaccess file in the root directory.

 

If you like, I will send you the .htaccess file from the oscommerce catalog directory, in the correct format, with the register_globals section not commented out. That way you simply have to upload it to your catalog directory and hopefully everything will work. If it is not edited and saved in the correct format, you could end up with more problems than you started with.

 

Let me know

Barb

Posted

In /includes/application_top.php try changing:

 

error_reporting(E_ALL & ~E_NOTICE);

 

to:

 

error_reporting(E_PARSE);

 

Matti

Posted

:D BINGO! :D

Wow, that did it! Thank you SO much!

 

I was tying so many other things that just wouldn't do it. I tried getting in touch with the people at tech support for my server so many times, and they were just useless when it came to this matter. After countless calls and several days, one of their systems administrators called me, and this guy knew his stuff. He gave me all my answers in a conversation that lasted few minutes. Basically, nothing I could try to do to any php.ini or .htaccess file would have any effect based on the way their shared server is set. Here's part of what he wrote back to me:

 

"Thank you for contacting Interland support regarding the questions about turning on register_globals. The server that your site is currently on can not have register_globals turned on. In an effort to secure the server register_gloabs have been turned off by the engineers. Due to the way the servers are setup and running php all the ways to enable register_globals through your own php.ini file, or through .htaccess will not work. You can contact your sales rep and upgrade to a VPS standard account which you would be able to turn on register_globals. Please contact us should you have additional issues or questions. You may login to our support site at http://support.Interland.com for updates on existing issues or to open a new ticket."

 

Basically, for everyone that offers their assistance theough this forum, I am so grateful for your time and advice. Just know in the future, if you have somebody using an Interland shared server, there's nothing that can be done via php.ini or .htaccess.

 

So it seems to work now. Thank you to everyone here.

 

I'm sure I'll be back for something...

 

Take care,

Bruce

 

 

In /includes/application_top.php try changing:

 

error_reporting(E_ALL & ~E_NOTICE);

 

to:

 

error_reporting(E_PARSE);

 

Matti

Archived

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

×
×
  • Create New...