昨日のブログにも書いたとおり、Ubuntuを
インストールしました。
せっかくなので、環境構築の手順を簡単に記録しておきます。
備忘録程度の走り書きなので、あまり実用性はないと思いますが、ご参考までに。
<要件>
・PHP5/SQLite/Apache2の導入
・Emacs+PHPーmodeの導入
<手順>
1.sudo apt-get install php5 を実行
2.sudo apt-get install sqlite を実行
3.sudo apt-get install apache2 を実行
4.
http://sourceforge.net/projects/php-mode/からphp-modeを
ダウンロードする。
5.php-modeを
解凍し、ディレクトリ内のphp-mode.elをEmacsのsite-
lispディレクトリにコピーする。
※僕の環境では該当ディレクトリは /usr/
share/
emacs/site-lisp
6.Emacsを起動して、php-mode.elを
バイトコンパイルする。
(1)[Alt] と [x] を同時押下
(2)byte-compile-
file と入力してEnter押下
(3)/usr/share/emacs/site-lisp/php-mode.el と入力してEnter押下
※コンパイル時に下記のworningが表示されましたが、とりあえず無視しています。
In php-mode:
php-mode.el:283:50:Warning: reference to free variable `php-block-stmt-1-key'
php-mode.el:287:50:Warning: reference to free variable `php-block-stmt-2-key'
php-mode.el:294:43:Warning: reference to free variable `php-class-key'
php-mode.el:332:34:Warning: reference to free variable
`php-imenu-generic-expression'
php-mode.el:369:8:Warning: assignment to free variable
`add-log-current-defun-header-regexp'
7.PHPのHTMLマニュアルをダウンロードして、usr/local/share/php/docに展開する。
8.homeディレクトリにファイル .emcacs を作成し、下記のLispコードを記述する。
(autoload 'php-mode "php-mode")
(setq auto-mode-alist
(cons '("\\.php\\'" . php-mode) auto-mode-alist))
(setq php-mode-force-pear t)
(add-hook 'php-mode-user-hook
'(lambda ()
(setq php-manual-path "/usr/local/share/php/doc/html")
(setq php-manual-url "
http://www.phppro.jp/phpmanual/"))
(setq tab-width 2)
(setq indent-tabs-mode nil))
手順6で発生するworningの意味が分からないので、ちょっと気持ち悪い。
とりあえず動いているので、このまま使ってみて、原因についてはおいおい調べていくつもりです。