Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

elruby's avatar

Deploy Laravel 5 with Mina Deploy with shared_paths gets a LoadConfiguration error.

I'm trying to deploy a Laravel 5 app in an EC2 server through Mina Deploy (http://nadarei.co/mina/)

I've realized that using the /config folder as shared_path configuration in mina deploy throws the following error:

PHP Notice:  date_default_timezone_set(): Timezone ID '' is invalid in /var/www/html/releases/29/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 41
PHP Fatal error:  Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler() in /var/www/html/releases/29/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php on line 54

I've tried several fixes but the only thing that it works for me it was put the .env file as shared between releases and let the config folder were overrode in all the deploys.

My mina configuration file:


require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv'  # for rbenv support. (http://rbenv.org)
require 'mina/rvm'    # for rvm support. (http://rvm.io)

# Basic settings:
#   domain       - The hostname to SSH to.
#   deploy_to    - Path to deploy into.
#   repository   - Git repo to clone from. (needed by mina/git)
#   branch       - Branch name to deploy. (needed by mina/git)

set :domain, '52.35.135.135'
set :deploy_to, '/var/www/html'
set :repository, 'https://repository...'
set :branch, 'master'
set :term_mode, nil

set :shared_paths, ['laravel/.env', 'laravel/storage']
set :user, 'dev'

task :environment do
  # If you're using rbenv, use this to load the rbenv environment.
  # Be sure to commit your .rbenv-version to your repository.
  # invoke :'rbenv:load'

  # For those using RVM, use this to load an RVM version@gemset.
  # invoke :'rvm:use[ruby-1.9.3-p125@default]'
end

# Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between
# all releases.
task :setup => :environment do
  queue! %[mkdir -p "#{deploy_to}/#{shared_path}/laravel/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/larave/config"]
  queue! %[mkdir -p "#{deploy_to}/#{shared_path}/laravel/storage"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/#{shared_path}/larave/storage"]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
  queue "export ..."
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    to :launch do
      queue "touch #{deploy_to}/tmp/restart.txt"
    end
  end
end

0 likes
0 replies

Please or to participate in this conversation.