Installing Magento
From InstallationWiki
| Official Page |
| Project Documentation |
| Download |
|
Contents |
[edit] System requirements
You must install Magento on a web server. There are many kinds of web servers, but Magento is designed to run best in a LAMP environment: Linux, Apache, MySQL, and PHP. It will run on Windows instead of Linux, but with some known issues that the official Magento site discusses. There are many low-cost hosting services that offer all the requirements for a successful Magento installation. Therefore, there is almost no excuse to settle for a service that is missing any of the requirements.
[edit] A list of requirements
Here is a short list of what your hosting service must provide. We'll discuss each of these items later.
| Requirement | Notes |
|---|---|
| Linux |
Your web server should run Linux. Other Unix-operating systems will also work, as will Windows. However, Linux is so popular among hosting services that you shouldn't settle for anything less than your exact requirement. |
| Apache web server
| As of this writing, the Apache web server is up to version 2.2. However, many hosting services still use the proven, reliable version 1.3. Either will work with Magento. |
| PHP 5.2.0 or newer |
PHP is a scripting language (a type of programming language). PHP is especially suited for web development. PHP code can be embedded into HTML pages to transform a static web page into something dynamic. Magento is written in PHP. It is built on the Zend Framework, which means it uses Zend's library. If you want to customize Magento code, you should know not only PHP, but also something about Zend. You can take special steps to install Magento on a web server that has only PHP version 4. However, so many hosting services have moved to PHP 5+ that you should not settle for less. |
|
PHP should have the following extensions and add-ons: PDO/MySQL mcrypt hash simplexml GD DOM iconv
| PHP's abilities can be increased with extensions and add-ons. The ones listed here are used by Magento, so your hosting service needs to have them installed like almost all hosting services do.
The easiest way to find out if your hosting service has the version and extensions you need is to ask their technical support department. However, if you want to obtain this information yourself, and you can upload a page to your host (maybe you're already a customer, or are on a trial period), see the next section. If you are setting up a localhost to try Magento, you might be using WAMP from the Apache Friends project. If so, you will also need to install the CURL library. |
|
MySQL 4.1.20 or newer |
MySQL is the world's most popular open source database. As of this writing, MySQL is up to version 5.1. Most likely any hosting service you are considering will offer a recent enough version for Magento. |
| An SMTP server |
SMTP stands for Simple Mail Transfer Protocol. Most email systems use SMTP to send messages from one server to another. When Magento needs to send an email (such as an order confirmation), it connects to your host's SMTP server and the server sends the email on Magento's behalf. Magento can also use a program called Sendmail to send emails. However, only a few hosts offer Sendmail. As almost all hosts offer SMTP, this tutorial will deal with SMTP. |
Many hosting services advertise LAMP, which covers four of the previous six requirements. Also, a list of their features will show you that they offer SMTP. That covers five of the six requirements. What about the PHP extensions? As stated in the table, the easiest way to find out if your hosting service offers the PHP extensions is to ask the technical support department. However, if you'd like to see for yourself, use the technique covered in the next section.
[edit] Determining which PHP version and extensions your web server has
You can see your server's PHP information by uploading and displaying a web page that has the phpinfo function.
Create a web page that has just these lines in it, and nothing else:
<?php phpinfo(); ?>
Save the file using any name you want, as long as it ends with .php, for example phpinfo.php.
Point your browser to the page you just created. For example, I pointed my browser to http://www.brew-me-a-cup.com/phpinfo.php. The page will look like the following screenshot:
As you scroll down the page, you will see the names of the PHP extensions that have been installed. For example, as you scroll down you will see a section for the DOM extension, which confirms that this extension is installed and working.
Keep scrolling until you find all the extensions listed in the table of the previous screenshot. Conversely, you can also scroll down to verify that an extension has not been installed on the server. To make it easier to find the extensions, you can search the page for their names. In Firefox, you can use Edit | Find, and in Internet Explorer you can use Edit | Find on This Page.
[edit] Do you have Apache's mod_rewrite and SSL?
Before proceeding with the installation, or even before choosing a hosting service, check with the hosting service to see if they have mod_rewrite installed and what it costs to obtain an SSL certificate. Both are explained in the sections that follow.
mod_rewrite makes user-friendly URLs
Compare these two URLs:
http://williamrice.com/node/267393?article=123&abc
http://williamrice.com/magazine/how-to-sell-more-coffee
They could both point to the same page. However, the second URL is easier for the user to understand and remember. It enables the user to see where (s)he is on your site (reading and article from the magazine section). Also, this link is easier to send in an email, and doesn't break in the Favorites or Tutorialmarks function of your browser. Lastly, search engines usually give better ranking to URLs that do not contain special characters, such as ? and &, and keywords that describe the content of the page.
Magento tends to create URLs like the first one. However, if your hosting service has an Apache module called mod_rewrite installed, then you can tell Magento to create friendly URLs like the second one. Check with your hosting service before you begin the Magento installation.
Do you need SSL?
SSL is the standard for secure transactions on the Web. SSL encrypts data—such as credit card numbers—as it travels between your browser and the site you are using. This prevents thieves from stealing that data. When you're on a page protected by SSL, its URL begins with https://.
Your browser alone cannot secure the transaction. The web site needs an SSL certificate.The SSL certificate does two things. First, it encrypts the data traveling between the site and your browser. Second, it helps to prove that the site actually belongs to the person who claims to own it.
Obtaining an SSL certificate is beyond the scope of this manual. However, many hosting services will add it to your account for a fee. This means you can just "upgrade" your service to an SSL certificate.
You don't need to decide on using SSL before installing Magento. You can install and configure your online store, and then add SSL later. Also, if you are using a third party such as PayPal, Authorize.net, or Google Checkout to process your payments, then payments will happen on their web site and not yours. They will use their SSL certificate, and you do not need it to protect your customer's credit card accounts.
Give this some serious consideration. Using SSL makes your site more secure. It also might make some people more comfortable about buying from your online store. Sometimes an increase in trust leads to an increase in business. Do your research, and decide if the extra expense is worth the potential increase in business.
[edit] Installing Magento
After you confirm that your web host meets the requirements for Magento, you are ready to install the software.
The major steps for installing Magento are listed as follows:
1.Download Magento from 1. http://www.magentocommerce.com.
2.Upload Magento to your web host.2.
3.Set rights for some of Magento's directories and files.3.
4.Create a MySQL database and database user for Magento.4.
5.Point your browser to the Magento directory and step through the installation wizard.5.
6.Test the frontend and backend of your Magento site.6.
After that, you're ready to start with creating your online store! Each of these major steps is covered in the subsections that follow.
Downloading Magento
In this section we will download and decompress the Magento files.
1.Getting the Magento files
Point your browser to http://www.magentocommerce.com/download. You will see a page like this:
The Magento team provides sample data that we can use if we want to play with Magento. This sample data includes product images and information that will appear on your site. Note that if we want to use this sample data, we must download and install it before we install the Magento software.
In the next tutorial, we will add our own products to Magento. Therefore, we will not need the sample data; we will create our store with our own data.
You can download Magento in several different formats. All of these formats—.zip, .gz, and .bz2—are just different ways of compressing files so that they occupy less space.
I chose to download the .zip file and save it to my local hard drive. Notice that I did not choose to decompress (that is, to unzip) the file.
Choosing that option would decompress the file while it's getting downloaded. Instead, I saved the .zip file intact to my computer:
I'll decompress the file later. However, I want the original ZIP file on my local hard drive, just in case I need it again. And, I have found that compressed files usually download faster and more reliably when you save them intact and decompress them after downloading, instead of decompressing them while they download.
2.Decompressing the Magento archive
I chose to download the .zip file because Mac OS X and Windows XP/Vista have built-in support for opening compressed .zip archives. Also, many Linux distributions, such as Ubuntu, have built-in support for .zip archives.
The next step is to decompress the .zip archive. In Windows, you can right-click on the file and select Extract All, as shown in the following screenshot:
On Mac OS X, you can right-click or Control-click on the file and select Open With | Archive Utility like this:
The result should be a folder on your local hard drive called magento, with subfolders that you will upload:
In the next step you will upload these folders to your site. But before you do that, let me explain why you decompressed the Magento archive on your local hard drive.
Many web hosts enable you to decompress a ZIP file that you upload to the host.For example, using the popular Control Panel software, I uploaded the Magento ZIP file to a web host.
I then selected the .zip file.
The host then offered to unzip the file for me. This capability is a part of most web hosting services.
The result is a subdirectory on my web site called magento, with all of the Magento files placed inside.
Again, it unzipped the files into a subdirectory, not the root directory of my web site. That meant when customers access my storefront, they would go to http://williamrice.com/magento. However, I want my customers to simply go to http://williamrice.com.
To do this, I would need to unzip the files on my local computer and upload them, so that I can control which directory they appear in. I don't want the ZIP file to create a subdirectory for Magento. Instead, I want to place the Magento files in the root directory of my site. That's why I unzip the file on my local computer and upload the individual files to my site.
What just happened?
At this point, you have all of the Magento files on your computer ready to be uploaded to your web host. The files are unzipped, so you can see how the files are organized into folders.
Uploading Magneto to your Web Host
1.Upload the unzipped files from the magento folder to your web host. I used a freeware FTP client called WinSCP, which you can get from http://winscp.net.
2.Notice that I uploaded the files to the root directory of http://brew-me-a-cup.com, so that visitors see my storefront as soon as they come to the site.
3.The following is a screenshot of the store's root directory after all the Magento files have been uploaded:
4.If you're installing Magento on a localhost, then the root directory will be the. htdocs folder. On my localhost, I used XAMPP from Apache Friends to run Apache, MySQL, and PHP. In the xampp folder, the folder htdocs holds my web files:
5.When I run Magento on my localhost, I will point my web browser to http://localhost/brew-me-a-cup.com.
[edit] Additional References
[edit] Source
The source of this content is Chapter 2: Installing Magento of Magento: Beginner's Guide by William Rice (Packt Publishing, 2009).
