diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ebdf77d22..8d9500e7078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed + - Config option 'php_version' should now be used for PHP version selection instead of 'use_php7' - Upgraded Varnish to v4.1 - Improved Magento re-installation speed by avoiding unnecessary cache cleaning - Custom code sniffer rules replaced with PSR2 ### Added + - PHP 7.1 support - Support for new location of `generated` directory in Magento 2.2.0 - Basic data generation can be turned off. Added configurable product and customer address generation diff --git a/README.md b/README.md index 5865fbc79ad..86ae58a0ab6 100755 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ * [Update Composer dependencies](#update-composer-dependencies) * [Running Magento tests](#running-magento-tests) * [Environment configuration](#environment-configuration) - * [Switch between PHP 5.6 and 7.0](#switch-between-php-56-and-70) + * [Switch between PHP versions](#switch-between-php-56-and-70) * [Activating Varnish](#activating-varnish) * [Activating ElasticSearch](#activating-elasticsearch) * [Redis for caching](#redis-for-caching) @@ -291,9 +291,9 @@ See [draft](https://github.com/paliarush/magento2-vagrant-for-developers/issues/ ## Environment configuration -### Switch between PHP 5.6 and 7.0 +### Switch between PHP versions -Set "use_php7: 1" for PHP7 and "use_php7: 0" for PHP5.6 in [config.yaml](etc/config.yaml.dist). +Switch between PHP versions using "php_version: " option in [config.yaml](etc/config.yaml.dist). Supported versions are 5.6, 7.0 and 7.1. PHP version will be applied after "vagrant reload". ### Activating Varnish @@ -358,7 +358,6 @@ Note: See [Working with npm](https://www.npmjs.com/package/n#working-with-npm) i ### FAQ - 1. Upgrade to PHP 7.1 can be done as described [here](https://gist.github.com/paliarush/6d88f3267de3bac636956f4be6bb3cd8#file-steps-to-upgrade-environment-to-php-7-1-md). Keep in mind that this is a temporary hack until proper support is implemented in the box 1. To debug any CLI script in current Vagrant project, set `debug:vagrant_project` option in [config.yaml](etc/config.yaml.dist) to `1` 1. Is Windows 10 supported? Yes, but you may face the same issue as described [here](https://github.com/paliarush/magento2-vagrant-for-developers/issues/36). Also Virtual box may not work on Windows 10 in headless mode, see how to [enable GUI mode](https://www.vagrantup.com/docs/virtualbox/configuration.html) 1. ![](docs/images/linux-icon.png)![](docs/images/osx-icon.png) On OSX and \*nix hosts NFS will be used by default to sync your project files with guest. On some hosts Vagrant cannot configure NFS properly, in this case it is possible to deploy project without NFS by setting `use_nfs` option in [config.yaml](etc/config.yaml.dist) to `0`
diff --git a/etc/config.yaml.dist b/etc/config.yaml.dist index 5e49957f76a..c91abf6a567 100644 --- a/etc/config.yaml.dist +++ b/etc/config.yaml.dist @@ -34,7 +34,7 @@ guest: environment: # [To apply changes: vagrant reload] Valid versions: 5.6, 7.0, 7.1 - php_version: "7.1" + php_version: "7.0" composer_prefer_source: 0 # [To apply changes: m-reinstall OR m-varnish enable/disable] use_varnish: 0 diff --git a/scripts/provision/configure_environment_recurring.sh b/scripts/provision/configure_environment_recurring.sh index 59a897fd69d..79e81b5ed9e 100755 --- a/scripts/provision/configure_environment_recurring.sh +++ b/scripts/provision/configure_environment_recurring.sh @@ -16,42 +16,6 @@ function process_php_config () { done } -function install_php71 () { - status "Installing PHP 7.1" - - apt-get update - - # Setup PHP - apt-get install -y language-pack-en-base - LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php - apt-get update - - # Install PHP 7.1 - apt-get install -y php7.1 php7.1-mcrypt php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-intl php7.1-xsl php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-zip libapache2-mod-php7.1 - - # Install XDebug - apt-get install -y php7.1-dev - cd /usr/lib - rm -rf xdebug - git clone git://github.com/xdebug/xdebug.git - cd xdebug - phpize - ./configure --enable-xdebug - make - make install - ## Configure XDebug to allow remote connections from the host - mkdir -p /etc/php/7.1/cli/conf.d - touch /etc/php/7.1/cli/conf.d/20-xdebug.ini - echo 'zend_extension=/usr/lib/xdebug/modules/xdebug.so - xdebug.max_nesting_level=200 - xdebug.remote_enable=1 - xdebug.remote_host=192.168.10.1 - xdebug.idekey=phpstorm' >> /etc/php/7.1/cli/conf.d/20-xdebug.ini - echo "date.timezone = America/Chicago" >> /etc/php/7.1/cli/php.ini - rm -rf /etc/php/7.1/apache2 - ln -s /etc/php/7.1/cli /etc/php/7.1/apache2 -} - function isServiceAvailable() { all_services="$(service --status-all 2> >(log))" if [[ ${all_services} =~ ${1} ]]; then @@ -116,10 +80,6 @@ fi status "Setting up PHP" -if [[ ! -d "/etc/php/7.1" ]]; then - install_php71 -fi - php_ini_paths=( /etc/php/5.6/cli/php.ini /etc/php/7.0/cli/php.ini /etc/php/7.1/cli/php.ini ) process_php_config ${php_ini_paths} diff --git a/scripts/provision/upgrade_environment_recurring.sh b/scripts/provision/upgrade_environment_recurring.sh index eb2362b85f6..e0ab67cc2fc 100755 --- a/scripts/provision/upgrade_environment_recurring.sh +++ b/scripts/provision/upgrade_environment_recurring.sh @@ -84,6 +84,46 @@ if [[ ${is_redis_installed} -eq 0 ]]; then echo -n | sudo utils/install_server.sh 2> >(logError) > >(log) fi +function install_php71 () { + status "Installing PHP 7.1" + + apt-get update + + # Setup PHP + apt-get install -y language-pack-en-base + LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php + apt-get update + + # Install PHP 7.1 + apt-get install -y php7.1 php7.1-mcrypt php7.1-curl php7.1-cli php7.1-mysql php7.1-gd php7.1-intl php7.1-xsl php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-zip libapache2-mod-php7.1 + + # Install XDebug + apt-get install -y php7.1-dev + cd /usr/lib + rm -rf xdebug + git clone git://github.com/xdebug/xdebug.git + cd xdebug + phpize + ./configure --enable-xdebug + make + make install + ## Configure XDebug to allow remote connections from the host + mkdir -p /etc/php/7.1/cli/conf.d + touch /etc/php/7.1/cli/conf.d/20-xdebug.ini + echo 'zend_extension=/usr/lib/xdebug/modules/xdebug.so + xdebug.max_nesting_level=200 + xdebug.remote_enable=1 + xdebug.remote_host=192.168.10.1 + xdebug.idekey=phpstorm' >> /etc/php/7.1/cli/conf.d/20-xdebug.ini + echo "date.timezone = America/Chicago" >> /etc/php/7.1/cli/php.ini + rm -rf /etc/php/7.1/apache2 + ln -s /etc/php/7.1/cli /etc/php/7.1/apache2 +} + +if [[ ! -d "/etc/php/7.1" ]]; then + install_php71 +fi + status "Fixing potential issue with MySQL being down after VM power off" service mysql restart 2> >(logError) > >(log)