2014-12-18



A long-waited Dev Beta of Magento 2 (0.42.0-beta1) appeared on Magento repository today. Of course we couldn’t sit still and installed Magento 2 on our server. And described the installation process for you, including the issues we dealt with and how we fixed them.

Precheck

The first steps lead us to the installation guide page. It is highly important to check whether your server suits minimal Magento 2 requirements:

Apache: 2.2 or 2.4

PHP: >=5.4.11 or 5.5.x (PHP 5.6.x is not supported officially, but there are rumors it works)

MySQL: 5.6.x

As Amasty servers work on Debian Wheezy, we installed Percona Server 5.6 so the server suits minimal database requirements, and we already have a server with PHP 5.5.x support. Also you’ll need Git and Composer, install it if you haven’t done it before.

Use these commands for Debian Wheezy with root user permissions:

Magento 2 download

Now it’s time to clone Magento 2 code from GitHub repository. http://magento2.local/ is the URL of our website, and the document root is /var/www.

The documentation also describes running ‘composer install’ from magento2/setup, but I don’t recommend doing that – it’s a mistake and it is added to the bugtracker several times (here, here and here). We clearly see that the developers have been waiting for the release impatiently and now are reporting bugs over each other.

File permissions

‘Admin’ user is the owner of all magento files on our server, and Apache web server runs on behalf of ‘www-data’ user. Magento 2 documentation describes the access permission settings for files and directories on the principle that the web server runs on behalf of the user which is the owner of all Magento files. Our opinion is: it’s not the best decision, as it can lead to security issues (as the web server has permissions to write and run the code) as well as issues with setting access permissions for third party developers (as you’re not logging in as www-data user). We normally use the following access permissions:

If you’re going to install Magento from the web interface, then add write permissions for app/etc/ and vendor/:

Database

We created an empty database on our new Percona Server 5.6 (mysql56.local), and most probably you’ll need to replace the values with your own ones:

Magento2 installation

The first time we tried to install Magento 2 using the web interface, but the process froze on 93%. The second installation was conducted from CLI, and we got an error:

This is a known issue, and it is connected with xdebug PHP extension, which is installed on our server. To fix this mistake we set xdebug.max_nesting_level = 500. The result was the successful installation of Magento 2 using the following command:

If you use xdebug as we do, add the following lines to the /var/www/magento2/.htaccess file:

If everything is correct, you will be able to log in the Magento 2 backend at http://magento2.local/admin/. Unfortunately, Sample data is not available for Magento 2 yet, so you’ll need to create the necessary data yourself.

Have you tried to install Magento 2 Dev Beta yet? What is your opinion?

The post Magento 2 installation guide appeared first on Amasty Blog.

Show more