Posted on

Command line Magento 1.5 install on MAMP

In my last big post on Magento deployment there were a number of simple little tidbits that on their own may be useful to people who might not be ready to jump headlong into the sort of project structure I described.

So with that in mind I thought I’d pull out the first of the useful tips, this time installing Magento 1.5 on MAMP (OSX) all via the command-line, it saves time and is nicely repeatable for scripting. Plus OSX is a unix system, why not make use of it!

In this little guide we’ll be installing Magento into your webserver’s document root. If that doesn’t mean anything to you, it may be worth checking out a couple of my earlier MAMP guides.

I wrote two related guides a while back that you may also find useful, for setting up MAMP based Magento development environments. Firstly a guide to installing MAMP on a Mac and secondly a way to set up virtual hosts on MAMP.

Update: Before we go any further, I included steps for downloading that use wget, which as Talesh quite rightly noted is not included with Mac OSX by default. I suggest you get wget on Mac OSX using Homebrew but there are other ways too.

Alternatively you can use curl to grab the file like this:

curl http://www.magentocommerce.com/downloads/assets/1.5.0.1/magento-1.5.0.1.tar.gz > magento-1.5.0.1.tar.gz

Ok, so we’re ready to begin. These commands should be copy-pastable, if anything goes wrong let me know.

cd ~/Downloads
# If you do not have wget installed (see above) you can use curl.
wget http://www.magentocommerce.com/downloads/assets/1.5.0.1/magento-1.5.0.1.tar.gz
tar xzf magento-1.5.0.1.tar.gz
#This assumes your document root is ~/Documents/web
mv magento ~/Documents/web/magento/1.5.0.1

Now we create the database, again we can do this on the commandline, to save time fluffing around with phpMyadmin.

# Your password is probably still 'root', unless you changed it.
/Applications/MAMP/Library/bin/mysql -uroot -p -e "create database magento1501"
# Put your own ulta secure password in place of 'password' below
/Applications/MAMP/Library/bin/mysql -uroot -p -e "grant all on magento1501.* to magento1501@'localhost' identified by 'password'"

Now we run the actual Magento install on the commandline. It pays to set the permissions before installing.

cd ~/Documents/web/magento/1.5.0.1
chmod -R o+w media var
chmod o+w app/etc

This next command runs the actual install. There are several things you need to change to match. others are optional, for example timezone, currency and locale can all be changed later in the admin, but for a local development environment the defaults are probably fine. The admin email/username/password, database details and base url are all important. Screwing these up will render the install broken – happily it won’t take you long to re-run the above commands and start over if that happens, right?

/Applications/MAMP/bin/php5/bin/php -f install.php -- --license_agreement_accepted "yes" --locale "en_US" --timezone "America/Los_Angeles" --default_currency "USD" --db_host "localhost" --db_name "magento1501" --db_user "magento1501" --db_pass "password" --url "http://127.0.0.1:8888/magento/1.5.0.1/" --use_rewrites "yes" --use_secure "no" --secure_base_url "" --use_secure_admin "no" --admin_firstname "max" --admin_lastname "power" --admin_email "ashley.schroder@gmail.com" --admin_username "admin" --admin_password "password"

Update: Thanks to Nathan for pointing out that the latest version of MAMP has a two versions of PHP in it. You’ll need to run:/Applications/MAMP/bin/php5.3/bin/php in the above command.

If it worked you’ll see something like SUCCESS: 183748... with a big long hash code. Now you should be able to see the default Magento start page here: http://127.0.0.1:8888/magento/1.5.0.1/ and log in to the admin panel at /admin.

Let me know if you have any troubles with getting these commands to work. I ran through them myself doing an install and everything was just fine, but if your environment is set up differently there could be some subtle issues.

Posted on

Magento 1.5.0.1 and SMTPPro 1.4.2 Now Working – Free Gmail/SMTP, ahoy!

There have been several reports of my SMTP Pro email extension failing on Magento 1.5. I hadn’t tested or recommended installing it on Magento 1.5 and wasn’t going to for a little while. You could say I’m not really an early adopter when it comes to Magento versions.

However, the ever helpful Rhonda (@rondata) from Magento got in touch with me late last week to report there may have been a packaging problem with my extension that has made it unable to be used on the new Magento Connect. So I thought if I was going to repackage it, I may as well also fix it up for Magento 1.5 – and so here is SMTPPro version 1.4.2.

As always you can download the package manually here (or via Magento Connect) to check it out before you install it manually.

I have tested the extension on Magento 1.4.2 and 1.5.0.1, also tested a Magento Connect install on 1.5.0.1. Everything seems to be in order. The change in 1.5 was a move to array based email addresses and names in the Email_Template class.

I still feel like it’s shoddy OO that I have to override an entire method and duplicate all the logic in it just to swap in my SMTP transport configuration. For those that care, I did try some techniques to avoid it, but the default transport is explicitly set by the core code if a return path is set, which invalidates anything I can do in a subclass – short of temporarily hijacking the return path configuration, which I may resort to doing in the next release.

In the process of testing a Magnto Connect install I did see a very cool feature in the latest Magento, and I may just have missed it in the earlier releases as I seldom use Magento Connect anymore.

Upload a  Package directly

Installing a package directly from within the downloader module will surely make the day of many commercial extension developers – at least until they can sell extensions directly on Magento Connect*.

Anyway, that’s about it – the new version supports 1.5, and can be downloaded/installed on Magento Connect. Go enjoy some free SMTP/Google Apps/Gmail email sending! Please let me know if you have any problems or spot any bugs.

* Speaking of which, I wonder what % Magento will take… Apple set a pretty high benchmark at 30%. Magento doesn’t quite have the same kung-fu grip on distribution though so maybe it’ll be lower.

Posted on

Magento Development and Deployment: Setting up a Modman based Magento project on Magento 1.5

As I had noted earlier this week, I have not had a lot of Magento development time lately, so today I thought I’d spend a bit of time setting up a Magento 1.5 development environment on my Mac. This post will take you through the steps to set up Magento development with Eclipse for editing/debugging and SVN for version control, with deployment being managed by Modman. This relates to the project structure I described in my presentation at Magento Imagine, with the exception that I won’t go into detail about setting up a separate extensions repository, as that is probably more relevant to developers who build and release extensions than developers working on a single Magento project.

What this guide assumes:

  • Mac development environment with MAMP
  • Linux production environment
  • SVN for version control, but Git can work too.
  • Modman for deployment. Written by Colin Mollenhour

What we will cover:

  • Installing SVN, Magento and Modman.
  • Getting a free SVN repository.
  • Setting up a Magento store development project with version controlled extensions, templates/themes, locale and emails.
  • Development and deployment of changes to Production.

We have a lot to get through, so let’s not delay.

Step 1: Install Magento Locally

We’ll zap through a commandline install. We’ll be installing into your web server doc root. If you would like help setting that up I wrote a guide to installing MAMP on a Mac (a long time ago) and also (extra for experts) a guide to setting up virtual hosts on MAMP too.

#In your ~/Downloads directory or some where suitable
wget http://www.magentocommerce.com/downloads/assets/1.5.0.1/magento-1.5.0.1.tar.gz
tar xzf magento-1.5.0.1.tar.gz
# I keep all of my Magento development versions in a web folder within ~/Documents
mv magento ~/Documents/web/magento/1.5.0.1

Continue reading Magento Development and Deployment: Setting up a Modman based Magento project on Magento 1.5

Posted on

Magento Imagine 2011 Presentation Notes and Links: Engineering your Magento Store

Just finished my presentation at Magento Imagine 2011 and wanted to drop a quick post with the links to various tools I mentioned and my slides on Engineering your Magento Store.

Thanks to everyone who asked interesting questions, glad to hear others are exploring this area of Magento store maintenance too.

You can get my slides here, I’ll have about 20 hours of flying to do this weekend so I’ll try to write up a more step-by-step guide as a blog post too. You may also find this blog post from last year interesting, if this project structure/deployment topic is relevant.

Update: I didn’t get the follow up written on the flight, but better late than never, check out my full step-by-step starter guide to Magento development and deployment with SVN and Modman here.

Links:
Modman deployment tool by Colin Mollenhour .
The cool-kid’s SCM, GIT.
The one I use, SVN.
Bug in Magento 1.4.2 that you should know about.

Posted on

New Version of SMTP Pro now supports Magento 1.4.2 and has fewer bugs

I’ve been neglecting my Magento extensions a bit lately and it somewhat ironically caught up with me yesterday. We’re developing a new store on Magento 1.4.2 and when it came to setting up the Google Apps email I naturally enough installed my own extension (that is why I built it, after all). This post describes the fixes and changes in the latest version of my SMTP Pro Magento email extension.

I found a number of issues with it, one related to the sub-directory install, one related to multi-store and others to do with the Magento version, that needed to be fixed (in a hurry). So to those of you reporting issues over the last month or so, sorry for the delay getting to them. Better late than never eh Fontis.

In addition to testing with Magento 1.4.2 which I can confirm works, here’s what I have fixed/changed:

  • Fixed the self-test when running it from a webstore installed in a subdirectory.
  • Fixed the Cannot set standard header from addHeader() exception. It was caused by an upgrade to Zend in Magento 1.4.2. Reported here.
  • Added German translations which I got from Thomas at NetResearch, Many thanks! (and apologies for taking months to finally roll them out).
  • Added better logging around the ‘not valid for send’ state.
  • Fixed the 404 error you get when running self-test on a store with the ‘use store code in url’ setting turned on. I suspect this may have been causing a few issues.

The SMTP extension is available on Magento Connect or you may prefer to download your Magento connect extensions manually. The release file for SMTP Pro version 1.4.0 is available here if you like to install Magento extensions manually.