Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

compatibility.php fatal error..


babylea

Recommended Posts

I have been testing a site and have this error come up:

 

 

Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in catalog/includes/functions/compatibility.php:18) in catalog/includes/functions/compatibility.php on line 18

 

 

I have searched the forums and found 1 post relating to this but the suggestion offered does not fix my problem.. I looked here for the topic I mentioned above.

 

Can anyone help please? I can't do anymore work on the site until this is resolved

 

Thanks

Link to comment
Share on other sites

That kind of error is because somewhere along the line your PHP code is "requiring" that module more than once.

 

As far as I can tell, it should be in "application_top.php" like this:

 

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

And nowhere else.

 

Search your PHP code to see if you can find where it's being "required" a second time, and "comment it out" like this:

 

//  require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

Just add "//" at the beginning of the line.

:)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

I've looked, and cannot find where it's asking for that again with regards to compatibility.php, but the actual error to me says that it's the magic that it's trying to run again "do_magic_quotes_gpc()"

 

Original Error:

 

Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /home/content/q/u/i/quicksale/html/catalog/includes/functions/compatibility.php:18) in /home/content/q/u/i/quicksale/html/catalog/includes/functions/compatibility.php on line 18

 

An I cannot figure it out...

Link to comment
Share on other sites

Try the solution in this post:

 

Click Me

 

Except, search for compatibility.php in your osC files.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Thank you for your response.

 

I downloaded and used Agent Ransack as you suggested, the only two files that compatibility.php appear in is application_top and compatibility itself... (both admin and store side)

 

I'm not quite sure what else to do :huh:

Link to comment
Share on other sites

Thank you for your response.

 

I downloaded and used Agent Ransack as you suggested, the only two files that compatibility.php appear in is application_top and compatibility itself... (both admin and store side)

 

I'm not quite sure what else to do :huh:

 

 

Made those changes, now I get this:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/content/q/u/i/quicksale/html/catalog/includes/functions/database.php:13) in /home/content/q/u/i/quicksale/html/catalog/includes/functions/database.php on line 13

Link to comment
Share on other sites

Babylea,

 

Try searching for do_magic_quotes_gpc and see where it's found at.

:)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Pablo,

 

Sounds like your "requiring" or "including" database.php more than once now, or you have tep_db_connect defined in another module somewhere.

 

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Pablo,

 

Sounds like your "requiring" or "including" database.php more than once now, or you have tep_db_connect defined in another module somewhere.

 

:blush:

 

 

 

All I did was install it! Son of a ......Why so many issues off fresh install?

Link to comment
Share on other sites

Why so many issues off fresh install?

That's a question to pose to the authors...

 

I'm just here to help where and when I can....

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

change require(DIR_WS_FUNCTIONS . 'compatibility.php'); to

require_once(DIR_WS_FUNCTIONS . 'compatibility.php'); and chek.

 

Probably YOU have uplaoded this file in language folder as well.

 

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

  • 1 month later...

I'd like to add my 2 cents in here. I had the same exact problem and just figured it out, maybe some of you have the same issue. I had just updated one of the contributions called Database Optimizer (a great contrib by the way). The old version had me put a call for the database optimizer file in index.php in the admin folder. The new version of database optimizer (2.0) has a call to application_top.php in it. So, index.php ends up calling application_top.php 2x and therefore, calling compatibility.php 2x. So, this is more hairy a problem to fix. You'll have to see what files call application_top.php - that's aLOT of files. Then, you'll have to comb through your files to see if there are any files that call application_top.php AND a nested file that also calls application_top.php.

 

Hope this helps some of you.

 

Scott

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...