Running XAMPP on Ubuntu using Terminal

To start XAMPP run the following and the command will return a list of running services:

sudo /opt/lampp/lampp start

To stop XAMPP run the command below and it will return a list of the stopped services.

sudo /opt/lampp/lampp stop

You can also stop/start/restart individual services by appending “apache”, “mysql” or “ftp” to the end.

Starting

start – Start XAMPP (Apache, MySQL and eventually others)
startapache – Start only Apache
startmysql – Start only MySQL
startftp – Start only ProFTPD

Stopping

stop – Stop XAMPP (Apache, MySQL and eventually others)
stopapache – Stop only Apache
stopmysql – Stop only MySQL
stopftp – Stop only ProFTPD

Restart

reload – Reload XAMPP (Apache, MySQL and eventually others)
reloadapache – Reload only Apache
reloadmysql – Reload only MySQL
reloadftp – Reload only ProFTPD
restart – Stop and start XAMPP

SSL & Security

security – Check XAMPP’s security
enablessl – Enable SSL support for Apache
disablessl – Disable SSL support for Apache

Config

backup – Make backup file of your XAMPP config, log and data files
oci8 – Enable the oci8 extenssion

GUI Panel

panel – Starts graphical XAMPP control panel

Magento2 CLI: Set Ubuntu PHP Version to match LAMPP/XAMPP

The Magento2 Comand Line Interface (CLI) needs to use the same version of PHP as your local web environment. You can check this by setting up an info.php script with in it “<?php phpinfo();” and comparing the output with the command “$ which php“.

You may find you are running two different versions of PHP each with its own PHP executable: by default one will be located in /usr/bin and another in somewhere like /opt/lampp/bin.

If you want to execute /opt/lampp/bin/php instead of /usr/bin, open your .bashrc file

sudo nano ~/.bashrc

At the very end add a new line:

PATH=/opt/lampp/bin:$PATH

Once you have saved .bashrc, run the command:

source .bashrc

You will now find bash is running the same PHP version and environment as your web server

Enable Magento2 Command-Line Interface (CLI) on Linux

For both development, ongoing management and scheduled tasks Magento’s Command Line Interface is able to do it all.

To enable CLI for Magento to you’ll need to make sure the file /bin/magento is executable by the system.

If you’re on the server SSH into the root of your Magneto install and run the command

chmod +x bin/magento

If you’re on desktop simply locate the file in your file explorer, right click and set the “Allow executing file as program” checkbox on the Permissions tab.

The latest update to PHP7 is here… 7.2.0

This month PHP released the latest update PHP7.2.0. While PHP 7.2 is an improvement, it is not groundbreaking as the jump from PHP5.6 to PHP7.0. However the biggest change, having encryption as part of the standard library in PHP, is very exciting. As PHP7 evolves and developers get more interesting tools to work with there are more and more reasons for dumping PHP5 and embracing the change.

Amongst the security updates there are a few cool new features and a couple of significant deprecations. Carlo Daniele has compiled a list here.

Running web applications on PHP7.2.0

Magento2 & PHP7.2.0

If you’re running Magento2 now might not be the best time to upgrade your PHP installation. It is important to note that both each() and mcrypt() have been removed from PHP 7.2. So stick with PHP 7.1, it doesn’t reach its end of life until 2019. Full list M2 requirements from Magento.

Magento 1 & PHP7

Out-of-the-box Magento 1.X installs are not designed to run on PHP7 at all. If you really need to run Magento 1.X on PHP7 Inchoo have created an our open-source compatibility extension for Magento and PHP 7 with impressive speed improvements. Details here

WordPress & PHP7.2

As you’d expect as long as your WordPress install is up to date it’ll run fine.

Shopify: Setting up a multipurpose CMSed liquid homepage section

Setting up a multipurpose CMSed liquid homepage section for Shopify.

The below schema includes two sets of data

  1. A YouTube Video display
  2. A list of testimonials (max 5)
{% schema %}
  {
    "name": "Video & Testimonial",
    "max_blocks": 5,
  	"settings": [
		{
          "id": "video_title",
          "type": "text",
          "label": "Heading",
          "default": "Learn 'How to' with our video"
		},
		{
          "id": "video_sub",
          "type": "text",
          "label": "Heading",
          "default": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed incididunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
		},
		{
          "id": "video_code",
          "type": "text",
          "label": "YouTube Code",
          "default": "GF60Iuh643I"
		},
		{
          "id": "video_image",
          "type": "image_picker",
          "label": "Background Image"
		}
  	],
  	"blocks": [
      {
        "type": "testimonial",
        "name": "Testimonial Option",
        "settings": [
          {
            "id": "testimonial_subject",
            "type": "text",
            "label": "Testimonial Subject"
      	  },
          {
            "type": "image_picker",
            "id": "image",
            "label": "Image"
          },
          {
            "id": "testimonial_desc",
            "type": "textarea",
            "label": "Testimonial Description"
          },
          {
            "id": "testimonial_author",
            "type": "text",
            "label": "Testimonial Author"
          }
        ]
      }
      
    ],
    "presets": [
      {
        "name": "Video and Testimonial",
        "category": "Testimonial",
		    "settings": {}
      }
    ]
  }
{% endschema %}

First we grab and display the variables from the Settings section of the JSON

<div class="medium-6 columns">
	<div class="content-wrap">
		<h3><span class="subheading">Learn 'How to' with our</span>{{ section.settings.video_title }}</h3>
		<p>{{ section.settings.video_sub }}</p>
		<a data-fancybox href="https://www.youtube.com/watch?v={{ section.settings.video_code }}" class="button">View Video</a>
	</div>
</div>
<div class="medium-6 columns">
	<a data-fancybox class="image-wrap" href="https://www.youtube.com/watch?v={{ section.settings.video_code }}">
		<img class="play-button" src="//cdn.shopify.com/s/files/1/2602/4064/t/2/assets/play-button.png">
		<img src="{{ section.settings.video_image | img_url }}">
	</a>
</div>

Then we grab the repeating testimonial blocks

{% if section.blocks.size > 0 %}
<section class="testimonial1 angle-bigarrow">
	<div class="row">
		<div class="small-12 column">
			<ul class="grid-1 wow fadeInUp">
				{% for block in section.blocks %}
				<li {{ block.shopify_attributes }}>
					<div class="testimonial-inner">
						<img src="{{ block.settings.image | img_url: '150x150' }}" alt="slider" />
						<h5>{{ block.settings.testimonial_author }}</h5>
						<p>{{ block.settings.testimonial_desc }}</p>
					</div>
				</li>
				{% endfor %}
			</ul>
		</div>
	</div>
</section>
{% endif %}

 

Shopify: List product variations on collection pages

The code below will allow you to display a set of product variations on a Shopify product collection pages.

Set this code in the collections page product loop, or within the liquid snippet that controls the display of products. On line three I’ve specified “Weight” as the option I want to display so on the list page the customer can see that I have 25ml, 50ml, and 100ml product sizes available.

{% for option in product.options %}
  {% if option == 'Weight' %}
    {% assign index = forloop.index0 %}
      {% for variant in product.variants %}
        {{ variant.options[index] }}
      {% endfor %}
    {% endif %}
{% endfor %}

CMS blocks disappear after version 1.9.2.2 upgrade or SUPEE-6788 patch

Magento veresion 1.9.2.2 and patch SUPEE-6788 both introduce a new security featuer to Magento. Blocks on the front-end have to be enabled or whitelisted before it will work.

Blocks can be added via a new Admin Panel section under Permissions > Blocks. Adding or allowing a new block is pretty streight forward:

  1. Navigate to System > Permissions > Blocks
  2. Click “Add New Block”
  3. Enter the block name: e.g. cms/block*
  4. Set “Is Allowed” to Yes

* Replace this with the name of the block that has disappeared

Running Ubuntu on Windows

One of my favourite aspects of Windows 10 has been the Linux subsystem for Windows.

I’ve been using it since launch partly because it sounded cool but also because a majority of my development projects are Linux based and when I’m interacting with a server I use Bash, a command line interface for Linux.

Day to day usefulness

As someone who daily has to interact with various servers it makes sense to use bash everywhere. On Windows with the Linux subsystem, you can Bash scripts, use command-line tools like sed, awk, grep, and you can even run Linux-first tools like Ruby, Git, Python, etc. directly on Windows.

You have complete access to your existing Windows filesystem from within Bash allowing you to work on the same set of files using both Windows applications and Linux command-line tools.

Desktop experiments

On the experimental side and with the addition of a window manager Xming X Server I have been able to run Linux applications such as Open Office, Firefox and Tor Browser from within the Linux subsystem on Windows.

 

Why is WordPress so popular?

WordPress is a free and open source software used by millions of people around the world to create websites and blogs. The most popular features of WordPress include its ease of use and ability to be extended way beyond the simple blog software it starts out as.

WordPress Northern Ireland

I’ve been developing WordPress websites for 10 years and am always looking for the next exciting project from personal blog, community portal or business website. Why not get in touch to see if I can help you with yours.

Front-end themes and templates can be easily downloaded from the official WordPress site or from hundreds of other places around the web. The same goes with extensions and plugins, which are used to extend the functionality of your WordPress site. A wide range of people contribute time, knowledge and skill to keeping the core WordPress software updated and secure.

There’s also a huge number of designers, developers & bloggers who share their knowledge through blog posts, tutorials, reviews, videos and the creation of thousands of themes & plugins.

It is estimated that WordPress could power as much as 29% of the world wide web. It is used for everything from personal blogs to large corporate websites with an even wider range of uses. From news sites and magazines to full e-commerce and online booking systems.

GDPR: What is the EU General Data Protection Regulation?

The General Data Protection Regulation (GDPR) will have an impact on how organisations handle the personal information that they look after.

GDPR is a regulation by which the European Parliament, the Council of the European Union and the European Commission intend to strengthen and unify data protection for all individuals within the European Union (EU). It also addresses the export of personal data outside the EU. The GDPR aims primarily to give control back to citizens and residents over their personal data and to simplify the regulatory environment for international business by unifying the regulation within the EU.

GDPR will have a role in four main areas:

1. Easier Access
Users will have easier access to their own data. Individuals will be better informed as to how their information is processed and stored and organisations will need to inform users in the clearest way possible.

2. Portability
Users should easily transfer their own information between service providers.

3. Right to be forgotten
Users that no longer want you to control or store their personal information you have processed should be able to easily have their data removed from your system unless there are legitimate grounds for keeping it.

4. Data breaches
Users should know that their information has been lost/stole or otherwise compromised. If your systems have been breached the users affected should be informed as soon as possible.

The implementation of the four points will depend on how you currently store and access user information. You will also need to be clear what you are using that information for.

 

Spammers: Murphy Consulting

You’ll have picked up from previous posts, I really don’t like spam. Running a website with a contact form I get a fair bit but occasionally I get spammed by what otherwise looks to be a reputable company and I have to call them out on it.

At Murphy Consulting (www.murphyconsulting.us) their number one goal is to create a mutually beneficial relationship with their partner, keep them happy and earn repeat business.

The spamming itself has been outsourced to the Philippines. Which itself is worrying for anyone taking-up Murphy Consulting as a web designer/developer or SEO agency. Brian Murphy at Murphy Consulting is already well known as a spammer. They are also known for ignoring SPAM warnings and violating terms of use of websites like this example.

If their own marketing capabilities are anything to go by they are best avoided.

I tried contacting Murphy Consulting via their Facebook and the Twitter account of another company that shares their office. Patrick Murphy and Brian Murphy are yet to respond to requests for help.

No response this far.

 

https://twitter.com/Keithology/status/940170964117151745

Checkout problems upgrading to Magento 1.9.3.4+

Magento version 1.9.3.4 include patch SUPEE-9767 V2 which includes security patching for the checkout process.

For your current front-end templates to work with this patch you will need to include a form key value to a number of forms in the checkout process.

<?php echo $this->getBlockHtml('formkey') ?>

Load the templates below from your  app/design/frontend/<package>/<theme> directory and add the Form Key code above between the <form> and </form> tags on each.

The basic templates that will need upgraded:

  • /template/checkout/cart/shipping.phtml
  • /template/checkout/onepage/billing.phtml
  • /template/checkout/onepage/shipping.phtml
  • /template/checkout/onepage/payment.phtml

If persistant checkout is enabled:

  • /template/checkout/onepage/shipping_method.phtml
  • /template/persistent/checkout/onepage/billing.phtml

If you allow shippinng to multiple addresses:

  • /template/checkout/multishipping/billing.phtml
  • /template/checkout/multishipping/shipping.phtml