Forums / General Questions / cannot login to admin after php update to v5

cannot login to admin after php update to v5

Locked

Started by bangsters on 15 Feb 2009, 2:22 PM · Views: 4,388

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
15 Feb 2009, 2:22 PM
#1
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

cannot login to admin after php update to v5

Hi.

We have updated PHP to V5, and now zencart won't login to admin. We can still place orders and all, but when we try to login it just goes back to the login page without any error or message.

I can reinstall the whole zencart, but is there another way to work around this? We have orders pending and we cannot go though them.

Thanks

15 Feb 2009, 2:35 PM
#2
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

What version of Zen Cart is this?

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

15 Feb 2009, 2:41 PM
#3
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

1.3.7 without any mods.

barco57:

What version of Zen Cart is this?

15 Feb 2009, 3:25 PM
#4
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

If logins loop back to themselves without any error message, then you have session problems ... namely, PHP was unable to start a session based on the configuration options selected in your site.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

15 Feb 2009, 3:27 PM
#5
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

barco57:

If logins loop back to themselves without any error message, then you have session problems ... namely, PHP was unable to start a session based on the configuration options selected in your site.

how come it only started after we updated php?

also, any workaround to this without reinstalling zencart?

15 Feb 2009, 7:45 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: cannot login to admin after php update to v5

bangsters:

how come it only started after we updated php?
It's not uncommon to find hosts breaking their PHP session functionality when they upgrade their PHP.
Usually they've forgotten to properly enable session support, or have altered the settings (used defaults perhaps? instead of the previous settings which worked better?), or have not set permissions properly on the session.save temporary folder, or numerous other possible things.
The server administrator will probably have to be the one to fix your server's session problems.

Re-installing Zen Cart will not likely accomplish anything if the server's config is broken.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Feb 2009, 8:03 PM
#7
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

If that is the case tho, then all installations of zencart in the same server should be affected. However they are not. Existing 1.3.7 carts are affected, but new installs, both 1.3.7 and 1.3.8 work perfectly fine.

Either way, any idea how I can have this fixed without doing a reinstall?

DrByte:

It's not uncommon to find hosts breaking their PHP session functionality when they upgrade their PHP.
Usually they've forgotten to properly enable session support, or have altered the settings (used defaults perhaps? instead of the previous settings which worked better?), or have not set permissions properly on the session.save temporary folder, or numerous other possible things.
The server administrator will probably have to be the one to fix your server's session problems.

Re-installing Zen Cart will not likely accomplish anything if the server's config is broken.

15 Feb 2009, 8:25 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

Peek in the Free Add ons for the Debug tool and load that on your site as instructed and see what errors generated to see if this is a session issue ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Feb 2009, 8:37 PM
#9
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

this is the error:

[15-Feb-2009 15:37:25] PHP Fatal error: Call to a member function Execute() on a non-object in /hsphere/local/home/user/domain.com/includes/functions/sessions.php on line 61
[15-Feb-2009 15:37:25] PHP Fatal error: Call to a member function Execute() on a non-object in /hsphere/local/home/user/domain.com/includes/functions/sessions.php on line 61
[15-Feb-2009 15:37:25] PHP Fatal error: Call to a member function Execute() on a non-object in /hsphere/local/home/user/domain.com/includes/functions/sessions.php on line 61

15 Feb 2009, 8:39 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

yeps that's the one ...

Are you both php 5 and MySQL 5 or just php 5?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Feb 2009, 11:16 PM
#11
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

just php5

...hey thanks again for the help guys!

15 Feb 2009, 11:43 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

Check the function files for sessions.php and compare them to the originals to make sure they are not changed ...

That is most likely where the problem is ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

15 Feb 2009, 11:58 PM
#13
bangsters avatar

bangsters

Zen Follower

Join Date:
Jun 2006
Posts:
168
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

i got it to work!!! woot! What i did was I copied the functions foloer in includes from another working site to the non-working site.

looks like some file got changed or corrupted somewhere in the functions folder.

all's working now.

thanks!!!!

16 Feb 2009, 12:00 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

Glad to hear things are working again ... most likely it was that sessions.php and updating it fixed the problem ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Apr 2009, 9:15 PM
#15
limey avatar

limey

New Zenner

Join Date:
Dec 2005
Posts:
44
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

I have something similar. I followed the advice above and the debug tool came up with:

[28-Apr-2009 16:45:08] PHP Fatal error: Call to a member function Execute() on a non-object in ****/includes/functions/sessions.php on line 72

I put in a new sessions.php but this just gave me 'illegal access'

I have not been able to get any input on upgrades on the server. Any because my admin is inaccessible I cannot find where to report what version of Zen cart I have. I think it is 1.2.6. It was fine until it just blanked out admin access and login stuff. So sounds like sessions but I don't know how to restore it.

Any input would be most welcome.

28 Apr 2009, 9:19 PM
#16
limey avatar

limey

New Zenner

Join Date:
Dec 2005
Posts:
44
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

... and how do I move on from 'illegal access'?

28 Apr 2009, 9:22 PM
#17
limey avatar

limey

New Zenner

Join Date:
Dec 2005
Posts:
44
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

Scratch that last one - I'm in again but back to the original problem as per the debug output.

29 Apr 2009, 1:35 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

In the session.php function files, add the php 5.x work around:

    function _sess_write($key, $val) {
      global $db;
      if (!is_object($db)) {
        //PHP 5.2.0 bug workaround ... 
        $db = new queryFactory();
        $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
      }

      global $SESS_LIFE;

      $expiry = time() + $SESS_LIFE;
      $value = $val;

      $qid = "select count(*) as total
              from " . TABLE_SESSIONS . "
              where sesskey = '" . zen_db_input($key) . "'";

      $total = $db->Execute($qid);

      if ($total->fields['total'] > 0) {
        $sql = "update " . TABLE_SESSIONS . "
                set expiry = '" . zen_db_input($expiry) . "', value = '" . zen_db_input($value) . "'
                where sesskey = '" . zen_db_input($key) . "'";

        return $db->Execute($sql);

      } else {
        $sql = "insert into " . TABLE_SESSIONS . "
                values ('" . zen_db_input($key) . "', '" . zen_db_input($expiry) . "', '" .
                         zen_db_input($value) . "')";

        return $db->Execute($sql);

      }
    }

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Apr 2009, 6:34 PM
#19
limey avatar

limey

New Zenner

Join Date:
Dec 2005
Posts:
44
Plugin Contributions:
0

Re: cannot login to admin after php update to v5

You are a star. Doughnuts and coffee on their way.

Much thanks.

29 Apr 2009, 7:06 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: cannot login to admin after php update to v5

Thanks for the update that this fixed your issues with php 5 and the Execute error ... :smile:

And thank you kindly for the donuts and coffee!! We greatly appreciate the support to help keep Zen Cart humming along ... :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!