Search code examples
magentophp-5.3

Magento (1.4.1) - Upgrade to PHP5.3, Admin login doesn't work


We just upgraded to PHP 5.3 on our test server to start using the Magento SOAP API. Our PHP 5.2.14 did not have PHP SOAP library installed.

I found that short_open_tags was off and the error logging was not turned on and made changes.

However, I cannot login to my Magento admin. It just spins for a second and then goes right back to the admin login page. No errors or exceptions thrown, no PHP errors logged.

I've made sure TZ was synched, /var/cache directory empty, /var/session directory empty, web/cookie config_data values correct, cleared browser cookie data...

I don't know where else to look or what else to do. Any ideas?

Updating things done:

Even though the config_data says that the time zone is America/Chicago, the code below placed in the adminhtml/login template shows this result:

UTC 08-02-2012 09:40:48 PM

Here's the code used:

echo date_default_timezone_get()."<br />\n";
echo date('m-d-Y h:i:s A');

Same code run from a separate PHP script returns this when run 3 secs earlier:

America/Chicago 08-02-2012 04:40:45 PM

Made changes to /store/app/Mage.php and /store/app/code/core/Mage/Core/Model/Locale.php to set TZ to America/Chicago and the admin login page now says

America/Chicago 08-02-2012 04:44:41 PM

but still no login.


Solution

  • If your admin login attempts are failing without an error being shown it almost always points to a problem with session handling.

    Either

    • a cookie can't be set
    • PHP can't start a session
    • the server's time is incorrectly synchronized resulting in cookies that instantly timeout
    • the domain magento is using to set the cookie doesn't match the domain you're using to access the site (check the core_config_data table for domain names and clear your cache),
    • you're accessing the site via a localhost domain, and running into one of the many browser bugs around cookie setting and localhost domains.

    Good luck!