Installation Guide

Prerequisites

Spryker Framework is delivered as a virtual machine (VM). This way, you don't have to worry about installation of services like a database or PHP modules.

To install our framework and get ready for development, please follow the steps described below.


1. Prepare Vagrant

To prepare Vagrant, you need to have the following components installed:

1
2
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-hostmanager

Before proceeding with the installation, please make sure you have your SSH public key in github.

In order to generate your SSH key, follow the steps presented in the following article : Generating SSH keys.


2. Install Spryker virtual machine

Create the folder on which you want the source code to be placed:

1
2
mkdir devvm
cd devvm

Initialize the Vagrant environment:

1
vagrant init devvm94 https://github.com/spryker/devvm/releases/download/ci-94/spryker-devvm.box

Edit the Vagrantfile and add the hostmanager configuration at the end (for Mac OS X/ Unix/ Linux):

1
2
 mv Vagrantfile Vagrantfile.bak
 awk '/^end/{print "  config.hostmanager.enabled = true\n  config.hostmanager.manage_host = true"}1' Vagrantfile.bak > Vagrantfile

Then, build the virtual machine:

1
vagrant up

Now, you can log into the VM using the following command in order to continue with the setup:

1
vagrant ssh

Your local code installation will be mounted as a network share inside the VM to /data/shop/development/current. Inside this folder, composer and npm will be used to install additional dependencies.

VM Configuration

If you want to change the default configuration of the virtual machine, you can do this by following the example below.

1
2
3
export VM_CPUS=2
export VM_MEMORY=8192
export VM_NAME="My custom name"

Disable shared folder

For non-standard setups you have the option to disable shared folder with Spryker code.

If you decide not to use shared folders feature, it’s your responsibility to get Spryker code into /data/shop/development/current directory inside your VM.

1
export VM_SKIP_SF=1

3. Install the Application

Next step is to install the application. For this, run the following command:

1
./setup -i

Windows compatibility

By default npm and antelope are using symlinks. /setup -i might fail on NTFS, to continue run: antelope install --nosym. After this step ./setup -i will work without using symlinks from now on, execute it again to rebuild everything from scratch.

The execution of this script will create the database and install the needed dependencies. Also, it will install the demo data and export it to Redis and Elasticsearch.

That’s all! The application is installed and ready to use. Now you can access the DemoShop front-end at http://www.de.demoshop.local and the back-end at http://zed.de.demoshop.local.

You can login to Zed with user admin@spryker.com and password change123.


Configure Git

If you want to commit from within the VM, it is recommended to set the right Git preferences:

1
2
3
4
git config --global user.email "your.email@domain.tld"
git config --global user.name "Your Name"
git config --global push.default simple
git config --global pull.rebase true

Filesystem Layout

A common Spryker Project is like a typical web project. There is the project level code and the framework code. Framework code is installed into the vendor folder. As you are running both Yves and Zed inside the VM, you will actually see the source code for both. They share a similar directory layout, but specific folders are indicated by the name of the application. So, a folder named Zed naturally belongs to Zed. A Shared folder belongs to Yves and Zed.

Path Usage
config various configuration files
data logfiles and caches
src your project code
static assets and the public document roots for Yves and Zed
vendor packages installed via composer. In particular vendor/spryker contains Yves and Zed bundles.

Services and Ports

Service Port Comments
MySQL Server 3306 Username is development, password is mate20mg
PostgreSQL Server 5432 Username is development, password is mate20mg
Redis 10009 You can explore Redis with e.g. Redis Desktop Manager

Activate the Opcache module

To optimize the performance of the system you can enable the Opcache. This is not recommend for development, because you may get strange results. To activate the Opcache just put the following lines at the end of the php.ini and restart php. This configuration is not optimized for production enviroments!

1
sudo nano /etc/php5/fpm/php.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[Cache]
; configuration for php ZendOpcache module
; priority=05
zend_extension=opcache.so

; Determines if Zend OPCache is enabled
opcache.enable=1

; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1

; The OPcache shared memory storage size.
opcache.memory_consumption=64

; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=8

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=8000

; The maximum percentage of "wasted" memory until a restart is scheduled.
opcache.max_wasted_percentage=5

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=1

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=1

; If enabled, a fast shutdown sequence is used for the accelerated code
opcache.fast_shutdown=1
1
2
3
sudo -i
service php5-fpm restart
exit

Upgrading to newer versions

To check for newer released versions, we recommend that you follow the steps described here


References

Documentation Description
Troubleshooting Troubleshooting Guide