2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Wordpress(PHP) on POW

Last updated at Posted at 2014-01-31

普段は、RailsやSinatraでRackサーバーのPowを使っていて、Wordpress(PHP)をいじるときに、Apacheとか余計なものを立ちあげたくない(port 80をpowが専有してしまう)
他にメリットとしては、

  • シンボリックリンク貼るだけでなので、複数プロジェクトを手軽に切り替えできる
  • xip.io連携で同一LAN内の端末からアクセスが簡単になる

1. gemインストール

gem install rack-legacy

2. config.ru 作成

プロジェクト配下にファイル作成
※ rack-rewrite使わずに、Rack::Legacy::Indexで対応できるようになりました。

config.ru
require 'rack/showexceptions'
require 'rack-legacy'

use Rack::ShowExceptions
use Rack::Legacy::Index
use Rack::Legacy::Php
use Rack::Legacy::Cgi
run Rack::File.new Dir.getwd

3. MySQL

MySQLを入れて、Wordpress用のDB作成(割愛)

  • brewで入れる
brew install mysql

4. シンボリックリンク

ln -s ~/Code/my-wordpress-site ~/.pow/my-wordpress-site

powderを入れてあれば、

powder link

5. アクセス

http://my-wordpress-site.dev

もしくは、

powder open

Reference

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?