Jump to content
Sign in to follow this  
Ian

PHP 4.3.0 and GV problems

Recommended Posts

I thought a new topic was warranted seeing as I seem to have found the fix for this.

 

The problem is obviously related to some problem/bug/misconfiguration with 4.3.0.

 

Hiowever the problem is caused by just one line in my GV code.

 

The line is in includes/classes/order_total.php in the collect_posts function

 

          $GLOBALS[$post_var] = $HTTP_POST_VARS[$post_var];

 

what appears to be happening is that if $HTTP_POST_VARS[$post_var] is null then the $GLOBALS array becomes corrupted.

 

The fix is to change the line to

 

if ($HTTP_POST_VARS[$post_var]) $GLOBALS[$post_var] = $HTTP_POST_VARS[$post_var];

 

make the change and hey - Bob's your Uncle

 

8)


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

I have verified that this *does* fix the bug!

 

HOOOOOORAY FOR IAN! though I'll rib you a little bit for not using if( !empty( <post_var> )) from the beginning <big big big big grin>

 

-chicken

Share this post


Link to post
Share on other sites

Now, what can we point to as the issue in PHP? Because like Ian said, there's obviously something wrong with PHP 4.3.0. I'm not certain if that patch for PHP (like others have mentioned) fixes the problem outright.

 

-chicken

 

ps. I'm mostly posted another comment because I forgot to check 'Notify me...'

Share this post


Link to post
Share on other sites

The fact that that one line of codethat has never caused problems before, and only emerged as a problem in 4.3.0 suggests strongly that their is a problem with 4.3.0.

 

Whether this will manifest itself elswhere is anyones guess.

 

BTW I would like to say thanks to Ryan Walker, who gave me unrestricted access to his server. Without that we could have been looking at this probblem for who knows how long.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

yeah it fixed the problem and everythings allright...

but the strange part was: no problem with the apache on linux but problem occured with apache on win2000 with same php version....

Share this post


Link to post
Share on other sites

Have you found any other problems with PHP 4.3

 

I cannot get osC to work using PHP 4.3

 

No products displayed in Admin or Catalog.


'Theres something about firemen, day and night they are always firemen'

Share this post


Link to post
Share on other sites

I had to change

  define('DB_SERVER', $HTTP_ENV_VARS['localhost');

 

to

  define('DB_SERVER', "localhost");

 

Because

$HTTP_ENV_VARS was breaking my configuration in 4.3.0

Share this post


Link to post
Share on other sites

what file did you change those settings to?

 

my configure.php already is set that way


'Theres something about firemen, day and night they are always firemen'

Share this post


Link to post
Share on other sites

glad to have found this posting. I just assumed I did something wrong. I'm on PHP 4.3 also and this fixed my problem!

 

Great going IAN! Do you take $$ contributions for all your help?

can't afford much, but every bit helps, right?

Share this post


Link to post
Share on other sites

**Also posted in General Chat**

 

My fully functional shop suddenly comes with error messages since my ISP upgraded php to 4.3.0.

 

In the catalog/default-section (storefront) header, i suddenly got an eror message reading:

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

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/www/htdocs/consumax/) in /www/htdocs/consumax/catalog/includes/header.php on line 30

 

Warning: The sessions directory does not exist: /tmp. Sessions will not work until this directory is created.

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

I could make this invisible by changing "true" to "false" in catalog/includes/ header.php :

 

// check if the session folder is writeable 

if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'false') { 

if (STORE_SESSIONS == '') { 

if (!is_dir(tep_session_save_path())) { 

tep_output_warning(WARNING_SESSION_DIRECTORY_NON_EXISTENT); 

} elseif (!is_writeable(tep_session_save_path())) { 

tep_output_warning(WARNING_SESSION_DIRECTORY_NOT_WRITEABLE); 

} 

} 

}

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

In the admin section i get the following header:

 

Warning: setlocale() [function.setlocale]: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in /www/htdocs/consumax/admin/includes/languages/dutch.php on line 12

 

This error however results in more errors as soon as i try to update a product..... for example:

 

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/consumax/admin/includes/languages/dutch.php:12) in /www/htdocs/consumax/admin/includes/functions/general.php on line 18

 

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

 

Does anybody have similar experiences, or does anybody know how to fix those errors?

 

Thnx in advance!

Larskovitch


Life is good...... but not for me ;-)

Al Bundy

Share this post


Link to post
Share on other sites

Hi Lars,

 

I have exactly the some error, because whe are with our shop on the some server by DEHEEG.NL

 

My error:

 

When I add or update a new_product I get the next error: (admin)

 

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/domain/shop/admin/includes/languages/dutch.php:12) in /www/htdocs/domain/shop/admin/includes/functions/general.php on line 18

 

It must have something to do with this PhP version upgrade.!!

 

So far as I see, it's onlt the admin section that gives errors.


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites

As I said in the other post. Try both suggestions and see what happends. It is worth a try. You'll never know unless you try.


Steve

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

Share this post


Link to post
Share on other sites

I am already trying...!!

 

I let you known if it's helps..!! it not..

 

 

I'l BE BACK (Swarzenegger)

 

Greetings JJ


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites

You guys are having different problems than me.

 

My problem is osCommerce does not display any products in either the admin or the catalog.

 

I have checked, they are in the database.

 

Anyone else run into this?

 

Mike


'Theres something about firemen, day and night they are always firemen'

Share this post


Link to post
Share on other sites

Hi l3ackdraft,

 

Wat is the url of your website??


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites

Hi toolcrazy,

 

Thanks...read that topic already, I am still investigate and try some things.

But still no solution

 

If there is progress I report it right away

 

JJ


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites
I thought a new topic was warranted seeing as I seem to have found the fix for this.

 

The problem is obviously related to some problem/bug/misconfiguration with 4.3.0.

 

Hiowever the problem is caused by just one line in my GV code.

 

The line is in includes/classes/order_total.php in the collect_posts function

 

          $GLOBALS[$post_var] = $HTTP_POST_VARS[$post_var];

 

what appears to be happening is that if $HTTP_POST_VARS[$post_var] is null then the $GLOBALS array becomes corrupted.

 

The fix is to change the line to

 

if ($HTTP_POST_VARS[$post_var]) $GLOBALS[$post_var] = $HTTP_POST_VARS[$post_var];

 

make the change and hey - Bob's your Uncle

 

8)

 

Ok, now I'm confused. I DL'd the newest snapshot, and the includes/classes/order_total.php file doesn't have that line anywhere in it. So I look at the CVS repository here :

http://cvs.sourceforge.net/cgi-bin/viewcvs...order_total.php

and none of them have that line. I DL'd Ian's "Loaded 4" and that file has that line. So did Ian write that code?

 

I'm confused because Ians version of that file says

v 1.1.1.1 2002/11/28

But there is no v1.1.1.1 listed in the repository. The only versions there are

v1.1 2002/04/03

v1.2 2002/04/08

v1.3 2002/11/23

v1.4 2003/02/11

So how is Ians version v1.1.1.1 and has a date AFTER the CVS v1.3?

Does this bug only affect Ian's Loaded version?

Share this post


Link to post
Share on other sites

order_total.php will only include that line if you have installed the Credit Class/GV contribution onto an osCommerce snapshot.

 

It's not part of a clean osCommerce snapshot.


Trust me, I'm an Accountant.

Share this post


Link to post
Share on other sites

I posted a other error on this forum, it was about:

 

Warning: setlocale() [function.setlocale]: Passing locale category name as string is deprecated. Use the LC_* -constants instead. in /www/htdocs/domain/shop/admin/includes/languages/dutch.php on line 12

 

 

dutch/php line 12 setlocale('LC_TIME', 'nl_NL.ISO_8859-1');

 

Remove the quotes (a least the ones around LC_TIME,)

 

After I removed the qoutes both problems are fixed...???

 

Many Thx to all who has contribute to fix my problem.

 

Greetings John2b


A friendship founded on business is better than a business founded on friendship

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×