2017-06-13 68 views
0

我試圖部署一個使用php deployer的Wordpress網站,但是我在共享文件夾中的wp-config.php文件有問題。Deployer php - 共享文件不起作用

當我部署時,這個不是共享的,我被重定向到/wp-admin/setup-config.php

我忘記了我的deploy.php配置文件中的內容嗎?

<?php 

namespace Deployer; 

require_once __DIR__.'/vendor/deployer/deployer/recipe/common.php'; 

// CONFIG /////////////////////////////////////////////////////////////// 
set('repository', '[email protected]:myrepo/surfblog.git'); 

set('shared_files', ['wp-config.php']); 
set('shared_files', ['wp-content/wp-cache-config.php']); 

set('shared_dirs', ['wp-content/uploads']); 
set('writable_dirs', ['wp-content/uploads']); 

set('keep_releases', 5); 
set('default_stage', 'recette'); 

// HOSTS /////////////////////////////////////////////////////////////// 
host('?.??.??.???') 
    ->user('root') 
    ->stage('recette') 
    ->set('deploy_path', '/home/www/surf/blog_test'); 

localhost() 
    ->stage('localhost') 
    ->set('deploy_path', '/home/kevin/Public/test'); 

// TASKS /////////////////////////////////////////////////////////////// 
task('deploy', [ 
    'deploy:prepare', 
    'deploy:lock', 
    'deploy:release', 
    'deploy:update_code', 
    'deploy:shared', 
    'deploy:vendors', 
    'deploy:writable', 
    'deploy:symlink', 
    'deploy:unlock', 
    'cleanup', 
])->desc('Deploy your project'); 

after('deploy', 'success'); 

它適用於我在本地主機中,但不在我的在線服務器上。

+0

我的第一個雖然是檢查是否混帳可以從遠程主機 –

+0

訪問存儲庫@ mr.void我可以。當我複製過去的'wp-config.php'文件時,該網站就可以正常工作 – Kevin

回答

1

作品一樣,

// CONFIG /////////////////////////////////////////////////////////////// 
set('repository', '[email protected]:myrepo/surfblog.git'); 

set('shared_files', array(
    'wp-config.php', 
    'wp-content/wp-cache-config.php', 
)); 
set('shared_dirs', array(
    'wp-content/uploads', 
)); 
set('writable_dirs', array(
    'wp-content/uploads', 
    'wp-content/cache', 
));