Skip to content
This repository has been archived by the owner on Mar 11, 2018. It is now read-only.

Setting Up a Local Environment on Linux (Apache)

Erik Helleren edited this page Apr 17, 2014 · 4 revisions
  • Install LAMP (if not already done)
  • Install Postgres according to your package manager or from source
  • Make sure the PHP plugin for postgresql is installed using # apt-get install php5-pgsql or the equivalent for your package manager
  • Execute the following commands in psql interactive shell...
CREATE DATABASE wordpress;
CREATE USER wordpress WITH PASSWORD 'wordpress';
GRANT ALL PRIVILEGES ON DATABASE wordpress to wordpress;
  • In your Apache config, add a SetEnv directive like SetEnv DATABASE_URL postgres://wordpress:wordpress@localhost:5432/wordpress
  • Change the first line of your wp-config.php to use $_SERVER["DATABASE_URL"] if DATABASE_URL not found in $_ENV:
if (isset($_ENV["DATABASE_URL"]))
  $db = parse_url($_ENV["DATABASE_URL"]);
else
  $db = parse_url($_SERVER["DATABASE_URL"]);

  • (Re)start Apache, and open http://localhost/wp-admin in a browser.

  • For people new to Apache, run sudo ln -s /full/path/to/wordpress-heroku/ /var/www/wordpress. This is a workaround to avoid poking around that much in Apache's configs. To access the blog locally go to http://localhost/wordpress/

Clone this wiki locally