From c6182e1fbe805a3de0ed31ac31b27c3b4208a88a Mon Sep 17 00:00:00 2001 From: Axel DE VIGNON Date: Tue, 31 Oct 2017 10:19:05 +0100 Subject: [PATCH] Switching to PHP7.1 --- README.md | 5 +++- cookbooks/lamp/recipes/default.rb | 48 ++++++++++++++++++++----------- create-vhost.sh | 9 +++--- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 36bb7eb..f5cb0f7 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Let me know if you encounter any issue. - Git (https://git-scm.com/) - Git-LFS (https://git-lfs.github.com) - Gulp (http://gulpjs.com/) -- PHP7 (http://www.php.net) : +- PHP7.1 (http://www.php.net) : - CURL - Dev - GD @@ -61,6 +61,9 @@ Let me know if you encounter any issue. - Zip - Sqlite3 - Memcached + - Redis + - GeoIP + - GMP - Mailcatcher (https://mailcatcher.me/) - MariaDB (MySQL) (https://mariadb.org/) - Memcached (http://www.memcached.org/) diff --git a/cookbooks/lamp/recipes/default.rb b/cookbooks/lamp/recipes/default.rb index 3bb2732..66d08b5 100644 --- a/cookbooks/lamp/recipes/default.rb +++ b/cookbooks/lamp/recipes/default.rb @@ -8,6 +8,7 @@ apt_update 'all platforms' do action :periodic end + ##################################### # VARIOUS TOOLS ##################################### @@ -18,6 +19,8 @@ package 'apt-transport-https' package 'build-essential' package 'curl' package 'unzip' +package 'lsb-release' +package 'ca-certificates' ##################################### # NTPDATE @@ -31,27 +34,39 @@ end ##################################### # PHP ##################################### -package 'php7.0' -package 'php7.0-curl' -package 'php7.0-dev' -package 'php7.0-gd' -package 'php7.0-json' -package 'php7.0-mysql' -package 'php7.0-readline' -package 'php7.0-xml' -package 'php7.0-intl' -package 'php7.0-mbstring' -package 'php7.0-mcrypt' + +apt_repository 'php7' do + action :add + uri 'ppa:ondrej/php' + distribution node['lsb']['codename'] + cache_rebuild true +end + +package 'php7.1' +package 'php7.1-curl' +package 'php7.1-dev' +package 'php7.1-gd' +package 'php7.1-json' +package 'php7.1-mysql' +package 'php7.1-readline' +package 'php7.1-xml' +package 'php7.1-intl' +package 'php7.1-mbstring' +package 'php7.1-mcrypt' package 'php-xdebug' -package 'php7.0-zip' -package 'php7.0-sqlite3' +package 'php7.1-zip' +package 'php7.1-sqlite3' +package 'php7.1-msgpack' +package 'php7.1-gmp' +package 'php7.1-geoip' +package 'php7.1-redis' ##################################### # MEMCACHE ##################################### package 'memcached' -package 'php-memcached' +package 'php7.1-memcached' service 'memcached' do action [:enable, :start] @@ -62,7 +77,7 @@ end # APACHE ##################################### package 'apache2' -package 'libapache2-mod-php7.0' +package 'libapache2-mod-php7.1' template '/etc/apache2/conf-enabled/users.conf' do source 'users.conf' @@ -70,11 +85,10 @@ end template '/etc/apache2/sites-enabled/000-default.conf' do source 'apache-000_default.conf.erb' - notifies :restart, "service[apache2]" manage_symlink_source true end -template '/etc/php/7.0/apache2/php.ini' do +template '/etc/php/7.1/apache2/php.ini' do source 'php.ini.erb' end diff --git a/create-vhost.sh b/create-vhost.sh index 7ab8196..034481f 100755 --- a/create-vhost.sh +++ b/create-vhost.sh @@ -11,7 +11,6 @@ function success { currentdir=`pwd` - who=`whoami` if [ "$who" = "vagrant" ] then @@ -19,21 +18,21 @@ then exit 1 fi + # Checking whether /etc/hosts file exists if [ ! -f "/etc/hosts" ] then error "Could not find the /etc/hosts file. I must abort..." exit 1 -else - success "We have detected the following path for the Vagrant root:" - success " > $currentdir" fi - echo echo "= APPLICATION CONFIGURATION =" echo +success "We have detected the following path for the Vagrant root:" +success " > $currentdir" + # Checking Vagrant root path echo