2016-05-15 84 views
1

我有一個現有的WordPress網站,可以在本地和在線服務器上正常工作。我只想把我的網站移到Heroku。 我已按照this教程部署到Heroku。爲什麼必須在heroku上部署後重新安裝現有的wordpress

但是,當我訪問myappname.herokuapp.com時,它要求我重新安裝WordPress。我該如何解決?

我刪除/wp-admin/import.php/wp-admin/install.php/wp-admin/install-helper.php/wp-admin/upgrade.php/wp-admin/upgrade-functions.php

/wp-config.php:

/** This should point to the app directory */ 
define('WP_SITEURL', "http://" . $_SERVER["HTTP_HOST"]); 
/** This is the URL your visitors will see */ 
define('WP_HOME', "http://" . $_SERVER["HTTP_HOST"]); 
define('WP_CACHE', true); 
define('WPLANG', 'vi_VI'); 
$url = parse_url(getenv('DATABASE_URL') ? getenv('DATABASE_URL') : getenv('CLEARDB_DATABASE_URL')); 
/** The name of the database for WordPress */ 
define('DB_NAME', trim($url['path'], '/')); 
/** MySQL database username */ 
define('DB_USER', $url['user']); 
/** MySQL database password */ 
define('DB_PASSWORD', $url['pass']); 
/** MySQL hostname */ 
define('DB_HOST', $url['host']); 
/** Database Charset to use in creating database tables. */ 
define('DB_CHARSET', 'utf8'); 
/** The Database Collate type. Don't change this if in doubt. */ 
define('DB_COLLATE', ''); 

/.htaccess:

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# END WordPress 

回答

0

當部署到Heroku的首次,你的數據庫將是空白的,不像是本地數據庫安裝在您正在使用的其他在線服務器上。由於Heroku數據庫是空白的,WordPress會要求您再次執行安裝。

我建議如下:

  1. 從頭開始重新進行部署。
  2. 不是刪除像你已經完成的任何文件。
    一)按照安裝步驟

    b)或導入現有的數據庫到數據庫的Heroku(超出這個答案的範圍)

+0

非常感謝你。有用。 – Sam

相關問題