Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Urgent! Help needed with catalog folder


osc_beginner

Recommended Posts

Hi. After my installation, when i go to http://mysite.myserver.com/catalog , the following error appears:

 

Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php on line 174

 

What is the reason for this. Line 130 in sessions.php is :

 function link_session_variable($var_name, $map)

and line 174 is

function link_session_variable($var_name, $map)

 

Do i have to remove anything?

 

Does anyone know what I have to change? Thanks for the advice in advance.

Link to comment
Share on other sites

Well, that's the 6th thread you've started on your installation problems - and you have been previously warned about double posting. If you keep on doing it the mods will bar you from using the forum - and then you'll be really stuffed!

 

Vger

Link to comment
Share on other sites

Well, that's the 6th thread you've started on your installation problems - and you have been previously warned about double posting.  If you keep on doing it the mods will bar you from using the forum - and then you'll be really stuffed!

 

Vger

 

 

Sorry, but its a different topic. Other users may also be facing similar problems. Can you help please.

Link to comment
Share on other sites

In PHP 'white space', being blank spaces or lines either before the opening php tag or after the closing tag is actually counted as being something (not just an empty space), so when you then start to do something the programme thinks it has already been started and throws up this error.

 

Vger

Link to comment
Share on other sites

Sorry, but its a different topic. Other users may also be facing similar problems. Can you help please.

 

You seem to be having a very hard time getting this to install and you should not be. The install is the easy part and can usually be cleared up quickly. I have not had this much trouble installing osC on a windows server and I thought that was bad. You might want to rethink your hosting as that may be part or all of your problem. You seem to be using a free hosting account and that is probably not a good idea. You need to have a decent hosting company if you are going to run a business.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Hi. After my installation, when i go to http://mysite.myserver.com/catalog , the following error appears:

 

Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/mysite.myserver.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/mysite.myserver.com/osc/catalog/includes/functions/sessions.php on line 174

 

What is the reason for this. Line 130 in sessions.php is :

 function link_session_variable($var_name, $map)

and line 174 is

function link_session_variable($var_name, $map)

 

Do i have to remove anything?

 

Does anyone know what I have to change? Thanks for the advice in advance.

 

Okay, but a different error has also appeared. when i go to http://mysite.myserver.com/catalog , the following error comes up:

 

Warning: mysql_connect(): Access denied for user: 'mysite_myserver_com@localhost' (Using password: YES) in /home/vhosts/mysite.myserver.com/osc/catalog/includes/functions/database.php on line 19

Unable to connect to database server! ,

 

Line 19 of this file is:

      $$link = mysql_connect($server, $username, $password);

 

So, does anyone know what the solution to both these errors is? Furthermore, i apologise for the hassle i'm giving you and i hereby would like to note that i'm very very much appreciative of your help.

Link to comment
Share on other sites

Okay, but a different error has also appeared. when i go to http://mysite.myserver.com/catalog , the following error comes up:

 

Warning: mysql_connect(): Access denied for user: 'mysite_myserver_com@localhost' (Using password: YES) in /home/vhosts/mysite.myserver.com/osc/catalog/includes/functions/database.php on line 19

Unable to connect to database server! ,

 

Line 19 of this file is:

 ? ? ?$$link = mysql_connect($server, $username, $password);

 

So, does anyone know what the solution to both these errors is? Furthermore, i apologise for the hassle i'm giving you and i hereby would like to note that i'm very very much appreciative of your help.

 

That error has nothing to do with the code but it means that your database info does not match what have in your configure.php files.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

This error means that you do no thave the correct User Name or Password for MySQL in your catalog/includes/configure.php file.

 

I echo what Richard said about free hosting on a sub domain.

 

Vger

Link to comment
Share on other sites

Thanks very much indeed. I have solved this problem but i still don't understand why the error : Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php on line 174 still comes up.

 

Please help.

 

P.S. I am making sure OSCommerce is the right solution. Then i will export to a proper domain. Thanks again.

Link to comment
Share on other sites

In PHP 'white space', being blank spaces or lines either before the opening php tag or after the closing tag is actually counted as being something (not just an empty space), so when you then start to do something the programme thinks it has already been started and throws up this error.

 

Vger

 

Asked and answered!

Link to comment
Share on other sites

Thanks very much indeed. I have solved this problem but i still don't understand why the error : Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php on line 174 still comes up.

 

Please help.

 

P.S. I am making sure OSCommerce is the right solution. Then i will export to a proper domain. Thanks again.

 

The problem with that plan is if your problems are caused by your hosting you never will get it up and running correctly and never know if is for you.

 

The osC install should be simple and even with a few problems should not take all that long. Invest a few bucks in a decent hosting account and try installing osC there and your life will be better.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Thanks very much indeed. I have solved this problem but i still don't understand why the error : Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php on line 174 still comes up.

 

Please help.

 

P.S. I am making sure OSCommerce is the right solution. Then i will export to a proper domain. Thanks again.

 

Just a quick suggestion. If you're merely testing osC out try installing apache, php, mysql on your local machine and starting there. You won't be subject to the vagueries of how your hosting company is set up and will get a quick education in all the parts that make it work as well.

 

There's not a whole lot you can't do from a local box that you can do from a live server anyways.

 

Hope that helps a bit,

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Hi. After my installation, when i go to http://mysite.myserver.com/catalog , the following error appears:

 

Fatal error: Cannot redeclare link_session_variable() (previously declared in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php:130) in /home/vhosts/testing123.realfreehost.com/osc/catalog/includes/functions/sessions.php on line 174

 

What is the reason for this. Line 130 in sessions.php is :

 function link_session_variable($var_name, $map)

and line 174 is

function link_session_variable($var_name, $map)

 

Do i have to remove anything?

 

Does anyone know what I have to change? Thanks for the advice in advance.

 

 

So, can anybody help???

Link to comment
Share on other sites

Furthermore, the following shows lines 130 to 180 from sessions.php if you find it useful:

 

function link_session_variable($var_name, $map)
 {
   if ($map)
   {
     // Map global to session variable. If the global variable is already set to some value
     // then its value overwrites the session variable. I **THINK** this is correct behaviour
     if (isset($GLOBALS[$var_name]))
     {
       $_SESSION[$var_name] = $GLOBALS[$var_name];
     }

     $GLOBALS[$var_name] =& $_SESSION[$var_name];
   }
   else
   {
     // Unmap global from session variable. Note that the global variable keeps the value of
     // the session variable. This should be unnecessary but it reflects the same behaviour
     // as having register_globals enabled, so in case the OSC code assumes this behaviour,
     // it is reproduced here
     $nothing;
     $GLOBALS[$var_name] =& $nothing;
     unset($GLOBALS[$var_name]);
     $GLOBALS[$var_name] = $_SESSION[$var_name];
   }
 }
// <<< END REGISTER_GLOBALS
// >>> BEGIN REGISTER_GLOBALS
 // Work-around function to allow disabling of register_globals in php.ini
 // This is pretty crude but it works. What it does is map session variables to
 // a corresponding global variable.
 // In this way, the main application code can continue to use the existing
 // global varaible names but they are actually redirected to the real session
 // variables
 //
 // If the global variable is already set with a value at the time of the mapping
 // then it is copied over to the real session variable before being mapped back
 // back again
 //
 // Parameters:
 // var_name - Name of session variable
 // map - true = map variable, false = unmap varaible
 //
 // Returns:
 // None
 function link_session_variable($var_name, $map)
 {
   if ($map)
   {
     // Map global to session variable. If the global variable is already set to some value
     // then its value overwrites the session varibale. I **THINK** this is correct behaviour
     if (isset($GLOBALS[$var_name]))

 

Thanks again for all your help

Link to comment
Share on other sites

This is really giving me a headache. Am i and osc_beginner the only people in world who have this problem. Someone else must have experienced these errors.

 

Come on guys, give us a jewel from your treasure chest of PHP knowledge.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...