VistaはProgram Filesをかなり厳しく見ているので、「httpd.confがいじれない!」とかなってしまった。そこで「c:\fujihara」フォルダを作り、そこにアプリをインストールして対応。自宅用だからこれでいっか。
MySQL管理用に「phpMyAdmin-2.11.9.2」もインストール。MySQLの管理はLinuxでも使う可能性があるのでphpMyAdminを使ってみる。
- The Apache HTTP Server Project
- PHP
- MySQL
- The phpMyAdmin Project
インストール
Apacheはインストールするときに「Custom」とかを選んで、インストールフォルダを「c:\fujihara」に指定。勉強用なのですべてのモジュールをつっこんでおくといいかも。
httpd.confの239行目あたりにあるDirectoryIndexにindex.phpを追加。
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
MySQLもインストールフォルダを「c:\fujihara」にして、インストール後にDBの設定ウィザードが開くので、「Best Support for Multilingualism」を選んだ。
PHPではApache2.xモジュールを選択してインストール。その他インストールするアイテムとして以下が必要。どれもphpMyAdminでつかってるらしい。
- Extensions/MySQL
- Extentions/Mcrypt
- Extensions/Multi-Byte String
- Extensions/zip
勉強用なので全部突っ込んどくか。
インストール後にmbstringの設定をphp.iniにした。
mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.http_output = UTF-8 mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none;
phpMyAdmin
phpMyAdminのconfig.sample.inc.phpをconfig.inc.phpにリネームする。ファイルを開くと
$cfg['blowfish_secret'] = 'fujihara'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
というのがあるはずなので、「fujihara」のように値を設定してあげる。
あとはhtdocsに「phpmyadmin」フォルダとか作ってファイルをそこにおいてあげるだけ。ブラウザからアクセスするとログイン画面が表示される。
なんだかよくわからんけど、MySQLで設定したroot/passではいれた。
httpd.exe: Could not reliably determine the server’s fully qualified domain name
使い始めて、突然Apacheが停止した。PHPも動作しなくなり真っ白なページが表示される。
イベントビューアを見るとエラーが出まくっていて、
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.0.2 for ServerName
と怒られてるみたいなのでhttpd.confのServerNameを「localhost:8888」、「Listen:8888」にした。
それ以外にも
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none) Cannot find module (SNMPv2-TM): At line 0 in (none) PHP Notice: Constant XML_ELEMENT_NODE already defined in Unknown on line 0 PHP Notice: Constant XML_ATTRIBUTE_NODE already defined in Unknown on line 0 PHP Notice: Constant XML_TEXT_NODE already defined in Unknown on line 0
とでているので、phpのモジュール全部をつっこんだのが原因かもしれず、php.iniの一番下で大量にロードしている部分をコメント化。以下だけにしたらなんとかうまくいった。
[PHP_MYSQL] extension=php_mysql.dll [PHP_MCRYPT] extension=php_mcrypt.dll [PHP_MBSTRING] extension=php_mbstring.dll [PHP_ZIP] extension=php_zip.dll [PHP_GETTEXT] extension=php_gettext.dll