Pages

Wednesday, May 20, 2009

Install Magento on Ubuntu - problems and solutions

Magento is one of best open source e-commerce systems at this time. So, I decide to install and play around with it to understand deeply its business concepts and the system architecture behind.

When install Magento on my Ubuntu, I met several problems. To save your time - if you want to play with magento, I share to you my experience to solve them here.

Problem 1: curl module loading error
You will meet this problem at beginning steps of installation. The root cause is: you haven't installed curl module for php. To solve this, please install php curl module.
I am using PHP5, so the easiest way to solve this for my case is: install php5-curl by apt-get

sudo apt-get install php5-curl
Restart apache and try again.

Problem 2: Can not login to both backend and front end with localhost
The problem occurs because magneto could not store cookies. We run it as localhost and localhost is not true domain but to store cookies we need a domain. That’s why login stops without saying any word.

There are 2 solutions to solve this
1. Use 127.0.0.1 instead of localhost: you can choose this if you just want to play with Magento - not deploying on production. Actually, this error never happens on live site (because on live site, we use true domain)
2. Go to magento/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

-Find the code,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
-Replace above code by,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

Problem 3: Can not rewrite url
Solution: load rewrite module in apache2. You can do this by add this line into /etc/apache2/apache2.conf at the end of file
LoadModule rewrite_module modules/mod_rewrite.so

Hope this helps.

7 comments:

joradom said...

BIG THANKS

I just spent 3 days for the solution to the login problem, of course I found nothing in the magento/site/forums.

ze1970 said...

Hi Man!

Your post was very helpful.
Thank you from Brazil!


z.

Anonymous said...

Thanks problem has been resolved

Magento eCommerce said...

I could not understand ubuntu. I think its computer please tell me this word meaning.Magento Developers

Abhay said...

what about magento version 1.4.0.1

i cant find this code there...
I changed the syuff i found there even then i cant make it work it out....

sukumar said...

Magento ecommerce sites is really very valuable software for shopping cart owners and custormer.
Magento Developers

Anonymous said...

You have to express more your opinion to attract more readers, because just a video or plain text without any personal approach is not that valuable. But it is just form my point of view