Peter89
Peter89

Reputation: 706

How to install a wordpress inside a rails on heroku

I unzip and rename wp-config-sample.php => wp-config.php and conffig it. it is exactly my file (i have no edit)

// Heroku Postgres settings

if (isset($_ENV["DATABASE_URL"])) {

  $db = parse_url($_ENV["DATABASE_URL"]);

  define("DB_NAME", trim($db["path"],"/"));

  define("DB_USER", $db["user"]);

  define("DB_PASSWORD", $db["pass"]);

  define("DB_HOST", $db["host"]);

} else {

  die("Cannot determine database settings from DATABASE_URL\n");

}

Then I create .htaccess (app/.htaccess) and config(i have no edit):

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

Then I upload it to blog folder on heroku. And try install but it always return eror 404 (I see logs heroku) my link to install:
http://mywebsite.heroku.com/blog/wp-admin/install.php

ActionController::RoutingError (No route matches "/blog/wp-admin/install.php

Please help me install this. Thanks so much

Upvotes: 0

Views: 1379

Answers (1)

John Beynon
John Beynon

Reputation: 37507

You can't do this - but not due to Heroku not having PHP - because it does. The Cedar stack added support for PHP Facebook applications but you are able to run Wordpress on them. See http://tjstein.com/2011/09/running-wordpress-on-heroku-and-amazon-rds/

HOWEVER You cannot mix languages in the same Heroku application, eg Rails and PHP - they would need to exist as separate Heroku applications. When the application slug is compiled the language is detected at that point.

Upvotes: 2

Related Questions