gpt4 book ai didi

symfony - Capifony + Symfony2 写入缓存文件失败

转载 作者:行者123 更新时间:2023-12-02 18:46:11 24 4
gpt4 key购买 nike

使用 capistrano 将我的开发环境部署到外部开发服务器时,我总是收到以下错误:

RuntimeException: Failed to write cache file "/var/www/xyz.co.uk/app/cache/dev/classes.php".

然后我必须登录我的开发服务器并删除我的 app/cache/dev/目录。

这是我的development.rb 文件:

server 'x.xx.xx.xxx', :app, :web, :db, :primary => true
ssh_options[:port] = 1234
ssh_options[:forward_agent] = true
set :deploy_to, "/var/www/xyz.co.uk"
set :symfony_env_prod, "dev"
set :branch, "develop"

# Need to clear *_dev controllers
set :clear_controllers, false

还有我的deploy.rb文件:

set :stage_dir, 'app/config/deploy' # needed for Symfony2 only
set :stages, %w(production staging development)
require 'capistrano/ext/multistage'

set :application, "xyz.co.uk"
set :user, "root" # The server's user for deploys

set :normalize_asset_timestamps, false

set :repository, "git@github.com:xyz/xyz.co.uk.git"
set :scm, :git
set :keep_releases, 3
set :use_sudo, false
set :web_path, "web"
set :shared_files, ["app/config/parameters.yml"]
set :shared_children, [app_path + "/logs", web_path + "/uploads"]
set :use_composer, true
set :update_vendors, true
set :dump_assetic_assets, true
set :deploy_via, :remote_cache

#logger.level = Logger::MAX_LEVEL

最佳答案

我的 deploy.rb 文件中有这个来设置缓存目录的权限:

after "deploy:update_code" do
capifony_pretty_print "--> Ensuring cache directory permissions"
run "setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX #{latest_release}/#{cache_path}"
run "setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX #{latest_release}/#{cache_path}"
capifony_puts_ok
end

关于symfony - Capifony + Symfony2 写入缓存文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15838981/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com