File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sourc
3535# Set required php version
3636MAGENTO_PHP_VERSION=" 7.2" ;
3737if $( dpkg --compare-versions " ${PROJECT_VERSION} " " lt" " 2.3" ) ; then
38+ MAGENTO_PHP_VERSION=" 7.1" ;
39+ fi
40+ if $( dpkg --compare-versions " ${PROJECT_VERSION} " " lt" " 2.1" ) ; then
3841 MAGENTO_PHP_VERSION=" 7.0" ;
3942fi
4043
@@ -47,18 +50,17 @@ apt-get update -y && apt-get install -y \
4750 php${MAGENTO_PHP_VERSION} -mysql php${MAGENTO_PHP_VERSION} -sqlite3 libapache2-mod-php${MAGENTO_PHP_VERSION} \
4851 php${MAGENTO_PHP_VERSION} -memcache php${MAGENTO_PHP_VERSION} -redis php${MAGENTO_PHP_VERSION} -opcache \
4952 python ruby ruby-dev
50- if [[ " ${MAGENTO_PHP_VERSION} " == " 7.0 " ] ]; then
53+ if [ " ${MAGENTO_PHP_VERSION} " != " 7.2 " ]; then
5154 apt-get install -y php${MAGENTO_PHP_VERSION} -mcrypt
5255fi
5356
54- # Set php version
55- PHP_VERSION=" $( php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,2,3) " ;
57+ # Set php version env
5658if [[ -z $( grep " PHP_VERSION" " /etc/profile.d/env.sh" ) ]]; then
5759cat << EOF >> /etc/profile.d/env.sh
58- export PHP_VERSION="${PHP_VERSION } "
60+ export PHP_VERSION="${MAGENTO_PHP_VERSION } "
5961EOF
6062else
61- sed -i ' /export PHP_VERSION*/c\' " export PHP_VERSION=$PHP_VERSION " /etc/profile.d/env.sh
63+ sed -i ' /export PHP_VERSION*/c\' " export PHP_VERSION=${MAGENTO_PHP_VERSION} " /etc/profile.d/env.sh
6264fi
6365source /etc/profile.d/env.sh
6466
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ mysql -u root -ppassword -e "GRANT ALL PRIVILEGES ON * . * TO 'vagrant'@'localho
2121mysql -u root -ppassword -e " GRANT ALL PRIVILEGES ON * . * TO 'vagrant'@'%';"
2222mysql -u root -ppassword -e " FLUSH PRIVILEGES;"
2323
24+
2425# -----------------------------------------------------------------------------------------------------
2526
2627
123124
124125# -----------------------------------------------------------------------------------------------------
125126
127+
126128# Apache php configuration
127129sed -i ' s/;opcache.enable=.*/opcache.enable=1/' /etc/php/" $PHP_VERSION " /apache2/php.ini
128130sed -i ' s/;opcache.enable_cli=.*/opcache.enable_cli=1/' /etc/php/" $PHP_VERSION " /apache2/php.ini
@@ -163,6 +165,7 @@ systemd-tmpfiles --create /etc/tmpfiles.d/php-cli-opcache.conf
163165
164166# -----------------------------------------------------------------------------------------------------
165167
168+
166169mkdir -p /var/www/html
167170chown -R www-data:www-data /var/www/
168171
@@ -208,6 +211,7 @@ cat <<'EOF' > /etc/apache2/sites-available/001-ssl.conf
208211</IfModule>
209212EOF
210213
214+ # Enable modules
211215a2dismod php7.0 php7.1 php7.2
212216a2ensite 000-default
213217a2ensite 001-ssl
Original file line number Diff line number Diff line change 7070
7171# Copy credentials to project user
7272chown -R vagrant:vagrant /home/vagrant
73+ mkdir -p /home/" $PROJECT_USER " /.composer /home/" $PROJECT_USER " /.ssh
7374cp -r /home/vagrant/.composer/* /home/" $PROJECT_USER " /.composer/
7475cp -r /home/vagrant/.ssh/* /home/" $PROJECT_USER " /.ssh/
7576chown -R " $PROJECT_USER " :" $PROJECT_USER " /home/" $PROJECT_USER "
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ if [ "$PROJECT_SOURCE" == "composer" ]; then
3939 magento/module-downloadable-sample-data magento/module-msrp-sample-data \
4040 magento/module-configurable-sample-data magento/module-product-links-sample-data \
4141 magento/module-wishlist-sample-data magento/module-swatches-sample-data \
42- magento/sample-data-media magento/module-offline-shipping-sample-data --no-update
42+ magento/sample-data-media magento/module-offline-shipping-sample-data
4343 fi
4444else
4545 # Install from git
You can’t perform that action at this time.
0 commit comments