Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Global vars, PHP version, PHP warnings


chrisbaker

Recommended Posts

I have been developing a site with this for two weeks and have found it to be highly configurable and easy to use! Thanks dev. team! I have a couple of questions, though:

 

(Installed mods: Register Globals, EasyPopulate, also added openWYSIWYG to product descriptions, source highly modded for CSS implementation and custom boxes.)

 

I installed Register Globals because the site's on a shared server and the host doesn't allow me to modify the php settings. After doing so, I have the error:

 

Warning: Unknown(): 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 Unknown on line 0

 

I have searched for fixes for this error and haven't found much help yet. Any assistence here would be appreciated (please remember, I don't have access to php.ini). I don't know if a change in .htaccess would work here or not. I am happy modifying code, so I'll take any hacks!

 

Also, my phpinfo() is showing that we're using PHP ver. 4.3.2. This is a bit older and seems to have some security holes (from a previous post I read). What are the problems with this version? Any links, etc. will help! I have the option to move to a new server in a couple of days, so any information on this soon would be helpful.

 

thanks, I appreciate it!

--Chris

Link to comment
Share on other sites

I installed Register Globals because the site's on a shared server and the host doesn't allow me to modify the php settings. After doing so, I have the error:

 

Warning: Unknown(): 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 Unknown on line 0

Ah, you have stumbled on the "didn't properly read the instructions despite big warnings to do so" bug. Depressingly very common in these parts :-)

 

Rich.

Link to comment
Share on other sites

All I can say is that I tried to read all the instructions! :(

 

After scanning through the file README, the only similarity is the session_write_close() warning. Your solution is to make a change to php.ini. If you read my message, it said that I'm on a shared server and don't have access to the php.ini file.

 

Is there another way to set session.bug_compat_42 = 0 and session.bug_compat_warn = 0? I can do this on my dev. box at home...but I have full rights there!

 

--Chris Baker

Link to comment
Share on other sites

Even on a shared server you sometimes have access to a 'local' php.ini file which allows you to change settings just for your website. Have a root through your FTP folders to see if there is one.

 

However, if you have installed Richard's Register Globals Patch correctly then you should be able to run the site with Register Globals set to off.

 

Vger

Link to comment
Share on other sites

Yes, apparantly that patch fixes the issues with global register on/off. Even though I have never had to use it, people who have used it gave it the thumbs up.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

I have confirmed the installation of the Register Globals patch. It's was completely installed :)

 

The note in the README regarding the warnings assumes that I can change my local php.ini settings. The problem with the README instructions (turning off the warnings); however, is that this patch was written for folks who don't have access to their php settings, correct?

 

If so, then I'm just stuck...with the warning.

 

Anything I'm missing?

 

I appreciate your help.

 

--Chris

Link to comment
Share on other sites

The note in the README regarding the warnings assumes that I can change my local php.ini settings. The problem with the README instructions (turning off the warnings); however, is that this patch was written for folks who don't have access to their php settings, correct?

...

No, not correct.

 

I wrote this for myself. I run OSC on my own server and I have full access to the system.

 

I don't have any experience at all of running anything on a shared server, hence the lack of instructions in this area. However, if you search the forums I'm sure you find that some helpful sole out there in OSC-land has posted a solution.

 

Rich.

Link to comment
Share on other sites

I wrote this for myself. I run OSC on my own server and I have full access to the system...

 

I don't have any experience at all of running anything on a shared server, hence the lack of instructions in this area....

 

If you have installed the Register Globals patch, and you don't have access to a php.ini file, and you don't have access to a .htaccess and your host will not change any php settings for you (e.g. you're on a shared server), then you can try the following:

 

At the top of your sessions.php file, add these three lines:

 

// Added to turn off php warnings (see register_globals contrib/patch readme)
ini_set("session.bug_compat_warn", "off");
ini_set("session.bug_compat_42", "off");

 

It seems to work for my implementation. I found this function (ini_set()) on another php-based cms forum and found it used inside osCommerce for e-mail settings, and even for register_globals.

 

got to go,

thanks,

--Chris Baker

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...