Search

Mar 15, 2016

Install MAGENTO 2

Install MAGENTO 2
Link step by step: http://devdocs.magento.com/guides/v2.0/install-gde/bk-install-guide.html

1/ Install apache2, mySQL, PHP
apache -v (2.2 or 2.4)
sudo apt-get install apache2


2/ PHP extension
bc-math, curl, gd, ImageMagick 6.3.7 (or later) or both
intl, mbstring, mcrypt, mhash, openssl, PDO/MySQL
SimpleXML, soap, xml, xsl, zip

INSTALL PHP 5.6.x
sudo apt-get -y update
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get -y update
sudo apt-get -y install php5 php5-common php5-mcrypt php5-curl php5-cli php5-mysql php5-gd php5-intl php5-xsl libapache2-mod-php5 libcurl3 
php -v (>= 5.5.22 or 5.6.x)

INSTALL imagemagick
sudo apt-get install php5-imagick

INSTALL MySQL
sudo apt-get install mysql-server-5.6 php5-mysql

curl --version (>= 7.34)

3/ Config memory_limit of PHP
Ubuntu: /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
Change memory_limit to:
memory_limit = 768M or more for normal operation
memory_limit = 2G or more for testing
upload_max_filesize
post_max_size
mod_rewrite module must be enabled: a2enmod rewrite
always_populate_raw_post_data = -1
Save your changes and Restart Apache: sudo service apache2 restart

4/ Create vitrual machine
sudo nano /etc/apache2/sites-available/magento.conf                    

< Directory /var/www/html/magento >
        Allow from all
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
< /Directory >

sudo a2ensite magento.conf 
sudo service apache2 reload
sudo service apache2 restart

5/ Create DATABASE
mysql -u root -p
CREATE DATABASE magento;
CREATE USER magento_user@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON magento.* TO magento_user@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

6/ Autoload error - Vendor autoload is not found. Please run 'composer install' under application root directory.
sudo apt-get update
sudo apt-get install curl php5-cli git

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
cd to magento folder
sudo composer install

Invalid credentials for 'https://repo.magento.com/archives/magento/composer/magento-composer-1.0.2.0.zip', aborting.
Create file ~/.composer/auth.json (Example)

{
    "http-basic": {
        "repo.magento.com": {
            "username": "a3615e9926c4efa2db13cb1182c5ca33",
            "password": "a3d1fd61a5e2346438b8c054e372c322"
        }
    },
    "github-oauth": {
        "github.com": "84926ebcfe71c881633e5b9de172877802s6aaf4"
    }
}

cd to magento folder
sudo composer install

7/ Permission folders and files
cd to /var/www/html and type: sudo chown -R www-data:www-data magento-folder
cd to magento folder and type:

sudo find . -type d -exec chmod 775 {} \; && sudo find . -type f -exec chmod 664 {} \; && sudo chmod u+x bin/magento


(Magento Recommend)
sudo find . -type d -exec chmod 770 {} \; && sudo find . -type f -exec chmod 660 {} \; && sudo chmod u+x bin/magento

sudo chmod -R 777 app/etc/ var/ pub/


8/ Go to http://localhost/project-name/setup/


No comments:

Post a Comment