Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Can’t render admin page
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

I have successfully set up a magento website on Bluehost and I want to clone it on my local wamp server.

Everything works fine except the admin access:

On local:

1. there is no http://localhost/magento/admin, I received 404 Not Found error.
2. I was suggested to use http://localhost/magento/index.php/admin, and the admin page appears, but it doesn’t let me log in and no any error message other than: Invalid User Name or Password.
3. I compared the admin_user table on my local and on Blushost via phpMyAdmin, they are identical.

What happened to this local clone? Can anyone help me out? This is my very first magento site and I just started to learn Magento, I have no any clue on what’s going on there.

Thank you in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

This occurs because Magento cannot store session in your localhost.

Posible fixes:

1) Use 127.0.0.1 but not localhost
2) Try Open Magento directory and go to the ‘app\\\\code\\\\core\\\\Mage\\\\Core\\\\Model\\\\Session\\\\Abstract’
open ‘Varien.php’ file

Find:

$cookieParams = array(
    
\\\'lifetime\\\' => $cookie->getLifetime(),
    
\\\'path\\\'     => $cookie->getPath(),
    
\\\'domain\\\'   => $cookie->getConfigDomain(),
    
\\\'secure\\\'   => $cookie->isSecure(),
    
\\\'httponly\\\' => $cookie->getHttponly()
);

Replace with

$cookieParams = array(
    
\\\'lifetime\\\' => $cookie->getLifetime(),
    
\\\'path\\\'     => $cookie->getPath(),
  
//  \\\'domain\\\'   => $cookie->getConfigDomain(),
  //  \\\'secure\\\'   => $cookie->isSecure(),
  //  \\\'httponly\\\' => $cookie->getHttponly()
);

Coment next lines also:

if (!$cookieParams[\\\'httponly\\\']{
  
unset($cookieParams[\\\'httponly\\\']);
  if (!
$cookieParams[\\\'secure\\\']{
  
unset($cookieParams[\\\'secure\\\']);
  if (!
$cookieParams[\\\'domain\\\']{
  
unset($cookieParams[\\\'domain\\\']);
  
}
  }
  }
 
if (isset($cookieParams[\\\'domain\\\'])) {
  $cookieParams[\\\
'domain\\\'$cookie->getDomain();
  
}

Try to log in

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Thank you so much for your help, I got new error message now (see the screenshot):

( ! ) SCREAM: Error suppression ignored for
( ! ) Parse error: syntax error, unexpected ‘$cookieParams’ (T_VARIABLE), expecting function (T_FUNCTION) in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 105
Call Stack
# Time Memory Function Location
1 0.0021 148840 {main}( ) ..\index.php:0
2 0.0204 334312 Mage::run( ) ..\index.php:87
3 0.0695 986176 Mage_Core_Model_App->run( ) ..\Mage.php:683
4 0.1682 1564456 Mage_Core_Model_App->_initCurrentStore( ) ..\App.php:349
5 0.3153 4316224 Varien_Autoload->autoload( ) ..\App.php:0
6 0.3173 4390488 include( ‘C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract.php’ ) ..\Autoload.php:93
7 0.3173 4390768 Varien_Autoload->autoload( ) ..\Autoload.php:0

Image Attachments
Screenshot - 11_28_2012 , 9_10_36 AM.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

Then also comment

call_user_func_array('session_set_cookie_params'$cookieParams);

Generally comment all line where can be found $cookieParams variable

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Same error:

( ! ) SCREAM: Error suppression ignored for
( ! ) Parse error: syntax error, unexpected ‘$cookieParams’ (T_VARIABLE), expecting function (T_FUNCTION) in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 105
Call Stack
# Time Memory Function Location
1 0.0017 145304 {main}( ) ..\index.php:0
2 0.0169 330784 Mage::run( ) ..\index.php:87
3 0.0425 982688 Mage_Core_Model_App->run( ) ..\Mage.php:683
4 0.1071 1560960 Mage_Core_Model_App->_initCurrentStore( ) ..\App.php:349
5 0.2037 4312664 Varien_Autoload->autoload( ) ..\App.php:0
6 0.2054 4386928 include( ‘C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract.php’ ) ..\Autoload.php:93
7 0.2054 4387208 Varien_Autoload->autoload( ) ..\Autoload.php:0

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

Can you please post code of this function “public function start($sessionName=null)” ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Sure, could you tell me where it is? Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

In Same file

2) Try Open Magento directory and go to the ‘app\\\\code\\\\core\\\\Mage\\\\Core\\\\Model\\\\Session\\\\Abstract’
open ‘Varien.php’ file

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Sorry, I didn’t realize the method is in the same file, here is the code:

public function start($sessionName=null)
{
if (isset($_SESSION)) {
return $this;
}

switch($this->getSessionSaveMethod()) {
case ‘db’:
ini_set(’session.save_handler’, ‘user’);
$sessionResource = Mage::getResourceSingleton(’core/session’);
/* @var $sessionResource Mage_Core_Model_Mysql4_Session */
$sessionResource->setSaveHandler();
break;
case ‘memcache’:
ini_set(’session.save_handler’, ‘memcache’);
session_save_path($this->getSessionSavePath());
break;
case ‘memcached’:
ini_set(’session.save_handler’, ‘memcached’);
session_save_path($this->getSessionSavePath());
break;
case ‘eaccelerator’:
ini_set(’session.save_handler’, ‘eaccelerator’);
break;
default:
session_module_name($this->getSessionSaveMethod());
if (is_writable($this->getSessionSavePath())) {
session_save_path($this->getSessionSavePath());
}
break;
}
$cookie = $this->getCookie();
if (Mage::app()->getStore()->isAdmin()) {
$sessionMaxLifetime = Mage_Core_Model_Resource_Session::SEESION_MAX_COOKIE_LIFETIME;
$adminSessionLifetime = (int)Mage::getStoreConfig(’admin/security/session_cookie_lifetime’);
if ($adminSessionLifetime > $sessionMaxLifetime) {
$adminSessionLifetime = $sessionMaxLifetime;
}
if ($adminSessionLifetime > 60) {
$cookie->setLifetime($adminSessionLifetime);
}
}

// session cookie params
$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath(),
// ‘domain’ => $cookie->getConfigDomain(),
// ‘secure’ => $cookie->isSecure(),
// ‘httponly’ => $cookie->getHttponly()
);

//if (!$cookieParams[’httponly’]) {
unset($cookieParams[’httponly’]);
if (!$cookieParams[’secure’]) {
unset($cookieParams[’secure’]);
if (!$cookieParams[’domain’]) {
unset($cookieParams[’domain’]);
}
}
}

//if (isset($cookieParams[’domain’])) {
$cookieParams[’domain’] = $cookie->getDomain();
}

//call_user_func_array(’session_set_cookie_params’, $cookieParams);

if (!empty($sessionName)) {
$this->setSessionName($sessionName);
}

// potential custom logic for session id (ex. switching between hosts)
$this->setSessionId();

Varien_Profiler::start(__METHOD__.’/start’);
$sessionCacheLimiter = Mage::getConfig()->getNode(’global/session_cache_limiter’);
if ($sessionCacheLimiter) {
session_cache_limiter((string)$sessionCacheLimiter);
}

session_start();

/**
* Renew cookie expiration time if session id did not change
*/
if ($cookie->get(session_name()) == $this->getSessionId()) {
$cookie->renew(session_name());
}
Varien_Profiler::stop(__METHOD__.’/start’);

return $this;
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

This lines also should be commented

//if (!$cookieParams[’httponly’]) { 
//unset($cookieParams[’httponly’]); 
//if (!$cookieParams[’secure’]) { 
//unset($cookieParams[’secure’]); 
//if (!$cookieParams[’domain’]) { 
//unset($cookieParams[’domain’]); 
//} 
//} 
//}

//if (isset($cookieParams[’domain’])) { 
//$cookieParams[’domain’] = $cookie->getDomain(); 
//}
 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Thanks. Now I got this error:

Invalid User Name or Password.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tentura
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2012-08-26
Germany
 

Than you have invalid username or Password ))))

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

Sounds like that, however, I carefully compared it with the live database on Bluehost, it’s the same, so I don’t think I typed in a wrong password.

But anyway, how can I add a new admin user or update admin user? Since no emailing function from my local wamp, I mgiht have to do this through phpMyAdmin? But how? I tried couple times updating it with no luck.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

I will see how can I create one more admin user and try again, by the way, is it possible to use Gmail for local wamp? If yes, then I can request password by email.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

In phpMyAdmin, I modified the password of admin to “admin”, it is still not working

Image Attachments
Screenshot - 11_28_2012 , 5_31_57 PM.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
mdivk
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2012-11-17
 

I changed the localhost’s admin password to be same as the one on Bluehost, now I am getting this error (seems to have that before):

( ! ) Fatal error: Call to undefined function curl_setopt() in C:\wamp\www\magento\lib\Varien\Http\Adapter\Curl.php on line 87
Call Stack
# Time Memory Function Location
1 0.0008 146824 {main}( ) ..\index.php:0
2 0.0082 332312 Mage::run( ) ..\index.php:87
3 0.0480 984184 Mage_Core_Model_App->run( ) ..\Mage.php:683
4 0.4175 4913392 Mage_Core_Controller_Varien_Front->dispatch( ) ..\App.php:354
5 0.4294 5131736 Mage_Core_Controller_Varien_Router_Standard->match( ) ..\Front.php:176
6 0.4495 5489704 Mage_Core_Controller_Varien_Action->dispatch( ) ..\Standard.php:250
7 0.4495 5490008 Mage_Adminhtml_Controller_Action->preDispatch( ) ..\Action.php:408
8 0.4644 5794632 Mage_Core_Controller_Varien_Action->preDispatch( ) ..\Action.php:160
9 0.5197 6650912 Mage::dispatchEvent( ) ..\Action.php:528
10 0.5198 6650912 Mage_Core_Model_App->dispatchEvent( ) ..\Mage.php:447
11 0.5889 6811176 Mage_Core_Model_App->_callObserverMethod( ) ..\App.php:1317
12 0.5889 6811176 Mage_AdminNotification_Model_Observer->preDispatch( ) ..\App.php:1338
13 0.6043 6852760 Mage_AdminNotification_Model_Feed->checkUpdate( ) ..\Observer.php:50
14 0.6055 6853160 Mage_AdminNotification_Model_Feed->getFeedData( ) ..\Feed.php:83
15 0.7757 7101640 Varien_Http_Adapter_Curl->write( ) ..\Feed.php:163
16 0.7757 7101944 Varien_Http_Adapter_Curl->_applyConfig( ) ..\Curl.php:166

Image Attachments
Bluehost admin user.jpglocalhost admin user.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2