centosにyumでphp-gdをインストール

centosyumでgdを入れたかったが

# yum -y install php-gd

すると

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-gd.i386 0:5.1.6-27.el5_5.3 set to be updated
--> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-gd
--> Finished Dependency Resolution
php-gd-5.1.6-27.el5_5.3.i386 from updates has depsolving problems
  --> Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-gd-5.1.6-27.el5_5.3.i386 (updates)
Error: Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-gd-5.1.6-27.el5_5.3.i386 (updates)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
[root@localhost locale]# yum update php-common
Loaded plugins: downloadonly, fastestmirror
Loading mirror speeds from cached hostfile

 こんなエラーが。色々試したが動かない...
最終的にこちらを参考にgdが入った(全体的にサイトの印象が暗くて怖い)
参考:http://blog.stompnoise.com/?p=42

#yum remove php-common

php-commonを消します.

#yum install php-gd

で、gdを入れる。ついでにphp-commonも入ります。ただ
php, php-cli, php-mbstring, php-mysql, php-pdoも一緒にremoveされてしまったのでそれらを入れ直す必要があります。

yum -y install php php-cli php-mbstring php-mysql php-pdo

これでOK.
自分の環境では phpinfo() で gdがenableになっているのを確認できました。

lighttpd で mod_rewrite を有効にする

.htaccessにRewriteRuleを書いても有効になるかどうかは未検証.

/etc/lighttpd/modules.conf の

server.modules = (

# "mod_rewrite",

)

mod_rewriteコメントアウトを解除する

/etc/lighttpd/lighttpd.conf の設定

$HTTP["host"] =~ "^(www\.)?sample\.com(\/(.*))?$" {
server.document-root = "/srv/www/.../htdocs"
url.rewrite-once = (
  "^/(.*)\.html$" => "/index.php?$1",
  "^/404$" => "/404/404.php"
)
}

rewriteルールは,で区切って複数書けます