The Killer Mind: Magento
Showing posts with label Magento. Show all posts
Showing posts with label Magento. Show all posts

Thursday, November 5, 2015

Install Magento 2 using Composer

6:00 PM 0
Install Magento 2 using Composer
If you’re new to Composer or package managers like Node’s NPM then you’ve got a lot to take in before you start working with Magento 2. You see, Magento 2 is dependent on Composer and all of its package/dependency goodness.
It’s true that Magento and several other developers have written articles detailing what I’m about to go through, but I decided to write this for the absolute beginner with deeper explanation of what is going on throughout the steps – particularly the role of Composer.

STEP 1: SERVER ENVIRONMENT

Magento 2 has new minimum requirements of your LAMP stack. I’m not going to list them here in case they change so please check the Magento 2 documentation for those prerequisites. A Vargrant setup is preferable but MAMP Pro can also work.

STEP 2: COMPOSER

If you’re unaware of what composer is then try this analogy. Composer is exactly like…. a composer. In this case Magento 2 is a musical and the packages installed are the members of the orchestra. Once installed in your project, Composer can be used to manage packages based on its dependency system. You can’t have a live musical without the orchestra and you can’t have Magento 2 without its packages. In both cases the composer is responsible for assembling components to allow the rest to work.
Fire up your command line tool and navigate to an empty folder where you’d like to install your copy of Magento 2. We need to ensure Composer is installed globally on your system so that you don’t have to repeat this step again.
Type the following command to see if composer is installed:
?
1
composer -help
If it’s not installed you’ll see the response command not found, which means you need to install Composer. Luckily it’s as simple as running the following two commands:
?
1
2
mv composer.phar /usr/local/bin/composer
The first command installs Composer into your local directory, the second will move the composer.phar file to a directory where it can be accessed globally by your system.
If you run the original command again you should see that Composer is installed and ready:
Install Composer

STEP 3: CLONE MAGENTO 2

To clone Magento CE 2 into your current directory run the Git following command:
It will clone the repo into a magento2 subdirectory, and this should take about 2-3 minutes depending on your broadband speed. Once it’s done run the following command to move into the Magento 2 root directory and checkout the master branch.
?
1
2
cd magento2
git checkout master
In order to work with Composer a project must have a composer.json file within its root directory. If you take a look at the file you’ll see a huge list of Magento 2 package dependencies. I’ve picked out first three below:
  • require: a list of packages (and versions) required by Magento 2. Magento 2 will not install if  any of those package dependencies are not met.
  • require-dev: a list of packages required by Magento 2 for development (includes running units tests, hence why PHPUnit is in there)
  • replace: shows a list of packages that are replaced by Magento 2, which is mostly made up of the main modules that make up the Magento 2 framework – this allows developers to fork specific packages with improved or customised code
To run Composer for the first time and install your packages simply run:
?
1
composer install
When upgrades become available you can install future updates by using:
?
1
composer update
The beauty is that upgrades will only run if Composer identifies a package’s dependencies can be met meaning the stack should always run smoothly.
Vagrant users should not find this a problem, however you may encounter missing PHP extensions when you install Composer, such as:
  • The requested PHP extension ext-mcrypt * is missing from your system.
  • The requested PHP extension ext-intl * is missing from your system.
For MAMP users, you can get around this by creating a symlink of your system’s PHP version to MAMPs. Firstly find out your PHP location:
?
1
which php // returns for example: /usr/bin/php
And then create the symlink:
?
1
2
sudo mv /usr/bin/php /usr/bin/php.bak
sudo ln -s /Applications/MAMP/bin/php/php5.6.10/bin/php /usr/bin/php
When Composer has finished its install you’ll be ready to install Magento. You can do this via command line, with Composer or through the installer interface.

STEP 4: INSTALL MAGENTO 2

The installer interface is better looking than before and it checks your server ‘readiness’ before allowing you to proceed with the install.
Magento Install

A Content Marketing Overview of BrightonSEO for Those Who Couldn’t Attend

5:55 PM 0
A Content Marketing Overview of BrightonSEO for Those Who Couldn’t Attend
We trekked over to Brighton for one of the biggest SEO marketing conferences in the UK – BrightonSEO – and what a buzz there was! By 8am there was a flux of Content Marketers, Outreach Consultants, Account Executives and SEO savvy experts waiting to get in and begin enhancing their SEO knowledge!

Key Takeaways

  • Before you plan promotion, you need to know why you are promoting this piece of content, for example is it to gain links? Is it to obtain further interaction via Social? For direct conversions? To gain new customers? Or to grow your existing customers?
  • Outreaching alone isn’t enough – if that’s the only way you’re getting your content out there, than you need to do more.
  • Find out where your audience is searching for content and what they are reading – this can be done through YouGov.co.ukFacebook Audience Insights and Google AdWords.
  • Messaging and headlines are key because people don’t read entire posts, the majority of people just read headlines! Ensuring your headline is eye-catching and appealing is a must – 1.7 million people won’t care about anything else!
President
  • This is something we already know but is extremely important – reviews. You must encourage customers to leave only positive reviews and discourage the negative. This will happen from providing customers with an excellent service, as well as a little push towards the reviews page!
  • Follow the news and write about things affecting the customer’s industry on their Social channels.
  • My favourite key takeaway was this: Social media does not take the weekend off! Yes we work weekdays, however we should be tweeting and writing posts on weekends too. Most companies make the common mistake of not writing the whole weekend, and leaving it until Monday morning.However, this is the time that people go onto Social Media channels such as Facebook and Twitter the most – and we all know how quickly social buzz can fizzle out, so make the most of the likes and shares.
Brighton SEO image

Favourite Speaker of the Day

My favourite speaker of the day was Stacey MacNaught who spoke about when your content is awesome, what the next stage is in order to get it to the top. Cathal Berragancame in close second, with his talk about how to gain millions of followers on Twitter!

Summarise Brighton in 5 Words

Informative Wealth of Content Delivered!

Quote of the day

Outreach is a promotion technique, if the only thing you are doing is outreaching, then you’re not doing enough”. Stacey MacNaught

Round-up of the Best Talks of the Day

Your Content is Awesome – Now What? – Stacey MacNaught
This was a very informative talk about how having good content is important, but the way you get it out there is becoming increasingly vital in getting readers engaged with what you’re saying.
Lessons Learned on the Way to Half of a Million Twitter Followers – Cathal Berragan
It was great to get a view of work from such a young and enthusiastic Content Director, Cathal, who spoke about how he started a Facebook page called ‘Exam Problems’. Thousands of young people joined and wrote within the group, because they were all going through the same situation, which he then went on to sell for a profitable amount of money – and all of this began from simply having good content!
Dave Trott - Brighton SEPO
Dave Trott was the closing keynote speaker. He talked about how there are always new devices coming out, but the person is the media – we are the ones who decide whether a device is good or not, and we decide if it should get passed or not. He also spoke about how there are two types of people – the formers and the followers. Formers do the talking and have a range of opinions, and the followers, well…follow! The key thing about followers is that they want to stay out of the spotlight so will follow content/social trends.

Daily News