Ref: https://github.com/shopware/shopware (Shopware 5)
https://github.com/shopware/platform (Shopware 6)
Install Shopware 5:
Clone the git to ‘shopware5’ dir:
|
1 |
teddy@teddy:~/Documents/works$ git clone https://github.com/shopware/shopware.git shopware5 |
Go to the dir
|
1 |
teddy@teddy:~/Documents/works$ cd shopware5/ |
Change the files permission
|
1 |
teddy@teddy:~/Documents/works/shopware5$ sudo chmod -R 755 custom/plugins engine/Shopware/Plugins/Community files media var web |
Go to ‘build’dir and use ‘ant’ to build the configuration and database.
|
1 |
teddy@teddy:~/Documents/works/shopware5$ cd build/ |
If not exist, install it first:
|
1 |
teddy@teddy:~/Documents/works/shopware5/build$ sudo apt install ant |
configure:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
teddy@teddy:~/Documents/works/shopware5/build$ ant configure Buildfile: /home/teddy/Documents/works/shopware5/build/build.xml configure: [input] Please enter db-host: [localhost] [input] Please enter db-port: [3306] [input] Please enter db-name: [] shopware5 [input] Please enter db-username: [] root [input] Please enter db-password: teddy [input] Please enter app.host (Hostname e.g. example.com): [] shopware5.test [input] Please enter app.path (e.g. /shopware. Leave blank if installed in document root): [] write-properties: [propertyfile] Creating new property file: /home/teddy/Documents/works/shopware5/build/build.properties BUILD SUCCESSFUL Total time: 41 seconds |
Build:
|
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
teddy@teddy:~/Documents/works/shopware5/build$ ant build-unit Buildfile: /home/teddy/Documents/works/shopware5/build/build.xml check-composer-binary: install-composer-binary: [exec] All settings correct for using Composer [exec] Downloading... [exec] [exec] Composer (version 1.9.0) successfully installed to: /home/teddy/Documents/works/shopware5/composer.phar [exec] Use it: php composer.phar [exec] update-composer-binary: [exec] You are running composer as "teddy", while "/home/teddy/.composer" is owned by "root" [exec] You are already using composer version 1.9.0 (stable channel). build-composer-install: [exec] Loading composer repositories with package information [exec] Installing dependencies (including require-dev) from lock file [exec] Package operations: 145 installs, 0 updates, 0 removals [exec] - Installing ocramius/package-versions (1.4.0): Loading from cache ... [exec] Package phpunit/dbunit is abandoned, you should avoid using it. No replacement was suggested. [exec] Generating optimized autoload files [exec] Warning: Ambiguous class resolution, "Doctrine\ORM\Persisters\Entity\BasicEntityPersister" was found in both "$baseDir . '/engine/Library/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php" and "/home/teddy/Documents/works/shopware5/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php", the first will be used. [exec] Warning: Ambiguous class resolution, "Doctrine\Common\Proxy\AbstractProxyFactory" was found in both "$baseDir . '/engine/Library/Doctrine/Common/Proxy/AbstractProxyFactory.php" and "/home/teddy/Documents/works/shopware5/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php", the first will be used. [exec] ocramius/package-versions: Generating version class... [exec] ocramius/package-versions: ...done generating version class [exec] > ./build/composer-post-install-cmd.sh [exec] + rm -rf -- /home/teddy/Documents/works/shopware5/build/../vendor/mpdf/mpdf/ttfonts ... build-cache-dir: [exec] WARNING! Could not connect to database. Message from SQL Server: SQLSTATE[HY000] [1045] Access denied for user '******'@'localhost' (using password: NO) in /home/teddy/Documents/works/shopware5/engine/Shopware/Components/DependencyInjection/Bridge/Db.php [exec] [exec] // Clearing the cache for the production environment [exec] [exec] [OK] Cache for the "production" environment was successfully cleared. [exec] build-config: [copy] Copying 1 file to /home/teddy/Documents/works/shopware5 build-database-foundation: [exec] WARNING! Could not connect to database. Message from SQL Server: SQLSTATE[HY000] [1049] Unknown database 'shopware5' in /home/teddy/Documents/works/shopware5/engine/Shopware/Components/DependencyInjection/Bridge/Db.php [exec] [exec] // Drop database [exec] [exec] // Create database [exec] [exec] // Import database [exec] [exec] Current MigrationNumber: 0 [exec] Found 618 migrations to apply [exec] Apply MigrationNumber: 101 - add-extended-editor-field ... [exec] Importing snippets for PluginManager plugin [exec] Plugin snippets processed correctly build-theme-initialize: [exec] Themes initialized build-create-admin-account: [exec] [exec] [OK] Adminuser "demo" was successfully created. [exec] build-install-lock-file: build-disable-firstrunwizard: [exec] First Run Wizard disabled install-git-hooks: build-unit: BUILD SUCCESSFUL Total time: 4 minutes 17 seconds |
Download the test images and extract them. Go to the root directory of your shopware system and download the test images:
|
1 2 3 |
teddy@teddy:~/Documents/works/shopware5/build$ cd .. teddy@teddy:~/Documents/works/shopware5$ wget -O test_images.zip http://releases.s3.shopware.com/test_images_since_5.1.zip |
BEWARE: the file size about 285MB !!!
Then unzip the file
|
1 |
teddy@teddy:~/Documents/works/shopware5$ unzip test_images.zip |
RUN PHP CLI — OR USE NGINX ??? BECAUSE IT’D REDIRECT TO http://shopware5.test/
|
1 2 3 4 |
teddy@teddy:~/Documents/works/shopware5$ php -S localhost:8090 PHP 7.1.32-1+ubuntu16.04.1+deb.sury.org+1 Development Server started at Fri Oct 11 11:25:44 2019 Listening on http://localhost:8090 Document root is /home/teddy/Documents/works/shopware5 |
THEN OPEN IT ON YOUR BROWSER: http://localhost:8090/shopware.php
NOTE: MUST USE PHP7.2. IF LOWER THAN THAT, IT’D DISPLAY THIS ERROR:
|
1 2 3 4 |
Error Your server is running PHP version 7.1.32-1+ubuntu16.04.1+deb.sury.org+1 but Shopware 5 requires at least PHP 7.2.0 Fehler Auf Ihrem Server läuft PHP version 7.1.32-1+ubuntu16.04.1+deb.sury.org+1, Shopware 5 benötigt mindestens PHP 7.2.0 |
If so, change the php version to 7.2 (min)
|
1 |
teddy@teddy:~/Documents/works/shopware5$ sudo ln -sfn /usr/bin/php7.2 /etc/alternatives/php |
Then run the php cli again
NGINX SETUP:
|
1 |
sudo gedit /etc/nginx/sites-available/shopware5.test |
CONTENT: (DONT USE THIS)
|
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
server { listen 80; listen [::]:80; root /home/teddy/Documents/works/shopware5; #your document root server_name www.shopware5.test shopware5.test ; # Your server name index index.php index.html index.htm ; # Webfonts,fonts location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header "Access-Control-Allow-Origin" "*"; expires 1y; access_log off; add_header Cache-Control "public"; } # Media: images, icons, video, audio, HTC location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # Js, Css location ~* \.(?:css|js)$ { expires 1y; access_log off; add_header Cache-Control "public"; } # Serve static files without touching php location / { try_files $uri $uri/ /index.php?$args; } # pass requests for dynamic content to site location ~ [^/]\.php(/|$) { try_files $uri /index.php; fastcgi_pass unix:/run/php/php7.3-fpm.sock; fastcgi_buffers 1024 4k; fastcgi_read_timeout 600s; fastcgi_connect_timeout 600s; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #include fastcgi_params; #FOR DEVELOPMENT MODE ONLY - BEGIN fastcgi_param MAGE_IS_DEVELOPER_MODE true; fastcgi_param PHP_VALUE display_startup_errors=on; fastcgi_param PHP_VALUE display_errors=on; fastcgi_param PHP_VALUE html_errors=on; fastcgi_param PHP_VALUE log_errors=on; fastcgi_param PHP_VALUE error_log=/home/teddy/Documents/works/shopware5/var/log/system.log; #FOR DEVELOPMENT MODE ONLY - END include fastcgi_params; } gzip on; gzip_disable "msie6"; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss image/svg+xml; gzip_vary on; # Banned locations (only reached if the earlier PHP entry point regexes don't match) location ~* (\.php$|\.htaccess$|\.git) { deny all; } } |
USE THIS: (READ: https://websiteforstudents.com/setup-shopware-on-ubuntu-16-04-18-04-lts-with-nginx-mariadb-and-php-7-1-fpm/)
|
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 |
server { listen 80; listen [::]:80; root /home/teddy/Documents/works/shopware5; index shopware.php index.php index.html index.htm; server_name shopware5.test www.shopware5.test; client_max_body_size 100M; location / { try_files $uri $uri/ /shopware.php$is_args$args; } location /recovery/install { index index.php; try_files $uri /recovery/install/index.php$is_args$args; } location /recovery/update/ { location /recovery/update/assets { } if (!-e $request_filename){ rewrite . /recovery/update/index.php last; } } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } |
Enable file config
|
1 |
sudo ln -s /etc/nginx/sites-available/shopware5.test /etc/nginx/sites-enabled/shopware5.test |
Register the host on my system
|
1 |
sudo gedit /etc/hosts |
Like this:
|
1 2 3 |
... 127.0.0.1 shopware5.test ... |
CHECK THE NGINX SETTING AND RESTART IT:
|
1 2 3 |
sudo nginx -t sudo service nginx restart |
CHANGE FILE PERMISSIONS
|
1 |
sudo chmod -R 777 var web/cache/ |
OPEN IT ON YOUR BROWSER: http://shopware5.test/
IT SHOULD WORK! IF NOT CHECK /var/log/nginx/error.log
AND THE ADMIN PAGE ON http://shopware5.test/backend/
username: demo
password: demo
Frontend users in demo data
Customer: test@example.com / shopware
B2B: mustermann@b2b.de / mustermann