Installing Magento on Ubuntu 8.0.4 with XAMPP

Last modified by dmstudios on Thu, June 24, 2010 15:22
Source|Old Revisions  

This is an old revision of the document!


This is a guide on how to install magento with XAMPP and Ubuntu 64bit OS (8.0.4). It is based on an excellent article Installing Magento Via SSH.

Although its final outcome is a working Magento host, it is missing the ability to update with Magento Connect Manager. Please feel free to add to this so that we can all benefit from this page.

SOLVED: The Magento Connect Manager issue has been resolved and tested on Ubuntu Jaunty 9.04. See step H below.

1. Installing & Setting up XAMPP

A. Install

Due to the fact that the Ubuntu version I chose was 64-bit, the following two steps (terminal commands) were necessary. If you are using a 32-bit version, you can also execute them. They are probably needed by xampp.

On a terminal execute:

 sudo apt-get update
 sudo apt-get install ia32-libs

Download xampp-linux-1.6.7.tar.gz from apache friends and save it to a directory of your choice. On a terminal execute:

 sudo tar xvfz xampp-linux-1.6.7.tar.gz -C /opt

This will install XAMPP on /opt

B. Verify

To start XAMPP simply call this command:

/opt/lampp/lampp start

You should now see something like this on your screen:

Starting XAMPP 1.6.7...

LAMPP: Starting Apache...

LAMPP: Starting MySQL...

LAMPP started.

If you now open a browser, and insert this address

http://localhost

you should see a page resembling the configuration page of XAMPP. Make sure that when you check the status, the following are reported

MySQL database                     ACTIVATED         
PHP                                ACTIVATED         
Perl                               ACTIVATED         
Common Gateway Interface (CGI)     ACTIVATED         
Server Side Includes (SSI)         ACTIVATED         

C. Setup a test database for later use from Magento

open the XAMPP configuration page

http://localhost

Navigate to myphpadmin and create a new database. Give it the name: magentotestdb

The user in this is the default: root

No password is required.

2. Installing Magento

A. Where?

At first we need to decide the directory Magento needs to sit in. In order to be able to access this site with XAMPP, Magento needs to be installed inside /opt/lampp/htdocs/ So we can create a directory inside htdocs called magentosite (Its better to perform the following as a superuser ‘su’ from the terminal. That way there will be no issues of permissions to write directories at this level). So open up a terminal and type:

su
cd /opt/lampp/htdocs
mkdir magentosite
cd magentosite

B. Download Magento

At this point we’re ready to download Magento (& the sample database)

IMPORTANT : You MUST download THIS VERSION (1.1.6) and not the latest version (1.3.2.2 as of this writing) from the Magento site. Using the latest version directly results in PEAR not being able to resolve host names properly. (This is a work around, help is still needed here.)

Don’t worry about this being an old version.. in step H we will upgrade successfully to the latest stable version via PEAR.

At the same terminal type

wget http://www.magentocommerce.com/downloads/assets/1.1.6/magento-1.1.6.tar.gz
wget http://www.magentocommerce.com/downloads/assets/1.1.2/magento-sample-data-1.1.2.tar.gz

Give your computer the time needed to download each package.

C. Uncompress downloaded files

At the same terminal type:

tar -zxvf magento-1.1.6.tar.gz 
tar -zxvf magento-sample-data-1.1.2.tar.gz

D. Move downloaded files to the appropriate magento directories

On the same terminal as before, execute the following commands

mv magento-sample-data-1.1.2/media/* magento/media/
mv magento-sample-data-1.1.2/magento_sample_data_for_1.1.2.sql magento/data.sql
mv magento/* magento/.htaccess .

E. Change initial permissions of files

chmod o+w var var/.htaccess app/etc
chmod -R o+w media

F. Add mysql location to the environment path

By doing this, we make mysql accessible from any path. To do this, edit the file /etc/environment and add /opt/lampp/bin

Something like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/lampp/bin"

G. Setup test data to the database

mysql -u root magentotestdb < data.sql

H. Modify your pear file to point to your PHP binary path

Open your pear file and modify it to reference the PHP binary path correctly.

gedit pear

Find the following line:

#MAGE_PEAR_PHP_BIN="php"

and replace it with this:

MAGE_PEAR_PHP_BIN="/opt/lampp/bin/php"

Note: The preceding steps are the solution to the issue detailed here: thread

Now run the magento script to setup all environment variables

./pear mage-setup .
./pear install -f magento-core/Mage_All_Latest-stable

J. Cleanup downloaded files

rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -rf magento/ magento-sample-data-1.1.2/
rm -rf magento-1.1.6.tar.gz magento-sample-data-1.1.2.tar.gz data.sql

K. Change final file permissions

 find . -type d -exec chmod 777 {} ;

L. BROWSE! AND INSTALL

We’re done! Navigate to

http://localhost/magentosite

During the installation procedure, choose local host as address of host and give the database name used above.

Check and be sure you can use Magento Connect (System > Magento Connect > Magento Connect Manager) once the installation is completed.

If you are greeted by ‘Error: Please check for sufficient file permissions’ don’t worry.. it’s an easy fix. Just set the file permissions for your magento folder to 777 like so:

sudo chmod -R 777 /opt/lampp/htdocs/magentosite

For more info on this error see thread




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs