1.PHP5のインストールと設定
1)C:\Program Filesの下にディレクトリ(フォルダ)「PHP5」を新規に作成する。
2)php-5.2.13-Win32.zip」を「C:\Program Files\PHP5」に展開(解凍)する。
OSが64ビットの場合は、「C:\Program Files (x86)\PHP5」になる。
3)「php.ini」のコピー
C:\Program Files\PHP5の中にある「php.ini-dist」というファイルを「php.ini」というファイル名で同じディレクトリにコピーする。
4)「php.ini」の編集
「php.ini」をメモ帳等で開いて以下のように編集する。
①include_path修正
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
include_path = ".;c:\Program Files\PHP5\includes" ← この行を追加する。
②extension_dirの修正
; Directory in which the loadable extensions (modules) reside.
;extension_dir = "./"
extension_dir = "C:\Program Files\PHP5\ext" ← この行を追加する。
③extensionの有効化
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll ← この行をコメント「;」を削除する。
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
extension=php_imap.dll ← この行をコメント「;」を削除する。
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll ← この行をコメント「;」を削除する。
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_msql.dll
;extension=php_mssql.dll
extension=php_mysql.dll ← この行をコメント「;」を削除する。
extension=php_mysqli.dll ← この行をコメント「;」を削除する。
;extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll ← この行をコメント「;」を削除する。
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll ← この行をコメント「;」を削除する。
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
④短縮タグを使用可能にする
short_open_tag = On ← 「On」になっていなければ、「On」にする。
⑤エラーメッセージを表示できるようにする。
error_reporting = E_ALL & ~E_NOTICE ← この行をコメント「;」を削除する。
⑥mbstringの設定
[mbstring]
; language for internal character representation.
mbstring.language = neutral ← この行をコメント「;」を削除し、「= meutral」にする。
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = SJIS
; http input encoding.
mbstring.http_input = pass ← この行をコメント「;」を削除し、「= pass」にする。
; http output encoding. mb_output_handler must be
; registered as output buffer to function
mbstring.http_output = pass ← この行をコメント「;」を削除し「= pass」にする。
; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
mbstring.encoding_translation = Off ← この行をコメント「;」を削除する。
; automatic encoding detection order.
; auto means
;mbstring.detect_order = auto
; substitute_character used when character cannot be converted
; one from another
;mbstring.substitute_character = none;
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0
⑦output_bufferingの設定
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit. You can enable output buffering during runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = 4096 ← 「= 4096」にする。
⑧session.save_pathの設定
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
; session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
session.save_path = "D:\wamp" ← この行をコメント「;」を削除し「= "D:\wamp"」にする。
⑨ディレクトリ「C:\Program Files\PHP5」にある「libmysql.dll」をディレクトリ「C:\WINDOWS\system32」にコピーする。