Windows システムへのインストール
PHP Manual

マニュアルインストール

This section contains instructions for manually installing and configuring PHP on Microsoft Windows. For the instructions on how to use PHP installer to setup and configure PHP and a web server on Windows refer to Windows Installer (PHP 5.2 and later).

Selecting and downloading the PHP distribution package

Download the PHP zip binary distribution from » PHP for Windows: Binaries and Sources. There are several different versions of the zip package - chose the version that is suitable for the web server being used:

注意: VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the » Microsoft 2008 C++ Runtime (x86) or the » Microsoft 2008 C++ Runtime (x64) installed.

The PHP package structure and content

Unpack the content of the zip archive into a directory of your choice, for example C:\PHP\. The directory and file structure extracted from the zip will look as below:

例1 PHP 5 パッケージ構造


c:\php
   |
   +--dev
   |  |
   |  |-php5ts.lib                 -- 非スレッドセーフバージョンの場合は php5.lib
   |
   +--ext                          -- PHP 拡張モジュールの DLL
   |  |
   |  |-php_bz2.dll
   |  |
   |  |-php_cpdf.dll
   |  |
   |  |-...
   |
   +--extras                       -- 空
   |
   +--pear                         -- PEAR の初期コピー
   |
   |
   |-go-pear.bat                   -- PEAR セットアップ用スクリプト
   |
   |-...
   |
   |-php-cgi.exe                   -- CGI 実行ファイル
   |
   |-php-win.exe                   -- コマンドプロンプトを開かずにスクリプトを実行する
   |
   |-php.exe                       -- コマンドラインの PHP 実行ファイル (CLI)
   |
   |-...
   |
   |-php.ini-development           -- デフォルトの php.ini 設定
   |
   |-php.ini-production            -- 推奨される php.ini 設定
   |
   |-php5apache2_2.dll             -- 非スレッドセーフバージョンには存在しません
   |
   |-php5apache2_2_filter.dll      -- 非スレッドセーフバージョンには存在しません
   |
   |-...
   |
   |-php5ts.dll                    -- コア PHP DLL ( 非スレッドセーフバージョンの場合は php5.dll )
   | 
   |-...

Below is the list of the modules and executables included in the PHP zip distribution:

Changing the php.ini file

After the php package content has been extracted, copy the php.ini-production into php.ini in the same folder. If necessary, it is also possible to place the php.ini into any other location of your choice but that will require additional configuration steps as described in PHP Configuration.

The php.ini file tells PHP how to configure itself, and how to work with the environment that it runs in. Here are a number of settings for the php.ini file that help PHP work better with Windows. Some of these are optional. There are many other directives that may be relevant to your environment - refer to the list of php.ini directives for more information.

Required directives:

Optional directives

以上で、Windows への PHP のインストールが完了しました。ついで、 使用する WEB サーバ にあわせて、PHP を利用可能とするための設定を行います。 目次から使用する WEB サーバを選択し、該当するセクションを参照してください。

PHP をウェブサーバ経由で実行するだけでなく、 .BAT スクリプトなどでコマンドラインから実行することもできます。 詳細は Microsoft Windows コマンドラインでの PHP を参照ください。


Windows システムへのインストール
PHP Manual