PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ActiveScript> <Windows インストーラ (PHP 5.1.0 以前)
Last updated: Fri, 03 Oct 2008

view this page in

マニュアルインストール

ここからは、Microsoft Windows に手動で PHP をインストールし、Web サーバを 設定する手順について説明します。

始めに、» http://www.php.net/downloads.php のダウンロードページから zip バイナリアーカイブをダウンロードしてください。

公式に配布されている Microsoft Window 向けの PHP インストーラを含め 多数のオールインワンのインストールキットが存在しますが、 まずは、幾ばくかの時間を割いて独力で PHP をセットアップしてみることをお勧めします。 そうすることで、システムをより理解することができ、PHP 拡張モジュールの インストールも必要に応じて容易にできるようになるでしょう。

注意: 前バージョンから PHP をアップグレードする場合
古いバージョンのマニュアルでは、ini ファイルおよび DLL ファイルをシステムフォルダ (C:\WINDOWS など) へ移動させることを推奨していました。この移動により、インストール手順は簡単になりますが、 アップグレードは面倒になっていました。 新しいバージョンのインストールにあたっては、これら移動させたファイル(システムフォルダ内の php.ini や PHP 関連の DLLなど)をすべて削除することを推奨します。 この時システムを壊さないようにするために、バックアップを確実に行ってください。 古い php.ini は新しい PHP を設定するのに有用です。 本解説で推奨する PHP のインストール方法は、以下の解説に示すとおり、すべての PHP 関連の ファイルをひとつのフォルダにまとめ、システムパスにそのフォルダを登録する方法です。

注意: MDAC 要件
Windows 98/NT4 を使用している場合には、 プラットフォームに合う Microsoft Data Access Components (MDAC) の最新版を 入手してください。» http://msdn.microsoft.com/data/ からダウンロードできます。MDAC が必要な理由は、ODBC が Windows バイナリにビルトインされているためです。

各サーバ特有の設定を行う前に、以下に示すステップを完了させてください。

まず、配布ファイルを適当なフォルダに展開します。PHP 4 の場合は、C:\ がよいでしょう。zip パッケージは php-4.3.7-Win32 のようなフォルダ名で展開されます。 PHP 5 の場合は、PHP 4 のようにフォルダ内に展開されないので、C:\php 内で展開してください。 他の位置に展開することもできますが、空白を含むパス (例:c:\program files\php) にすることはお勧めできません。Web サーバによってはクラッシュを引き起こします。

展開されたフォルダの構造は、PHP 4 と PHP 5 とで異なり、以下のようになります。

例1 PHP 4 パッケージ構造


c:\php
   |
   +--cli
   |  |
   |  |-php.exe           -- CLI 実行ファイル - コマンドラインでのスクリプト実行専用
   |
   +--dlls                -- 拡張モジュールの利用に必要な DLL
   |  |
   |  |-expat.dll
   |  |
   |  |-fdftk.dll
   |  |
   |  |-...
   |
   +--extensions          -- PHP 拡張モジュールの DLL
   |  |
   |  |-php_bz2.dll
   |  |
   |  |-php_cpdf.dll
   |  |
   |  |-...
   |
   +--mibs                -- SNMP 用サポートファイル
   |
   +--openssl             -- Openssl 用サポートファイル
   |
   +--pdf-related         -- PDF 用サポートファイル
   |
   +--sapi                -- SAPI (server module support) DLL
   |  |
   |  |-php4apache.dll
   |  |
   |  |-php4apache2.dll
   |  |
   |  |-...
   |
   +--PEAR                -- PEAR の初期コピー
   |
   |
   |-go-pear.bat          -- PEAR セットアップ用スクリプト
   |
   |-...
   |
   |-php.exe              -- CGI 実行ファイル
   |
   |-...
   |
   |-php.ini-dist         -- デフォルトの php.ini 設定
   |
   |-php.ini-recommended  -- 推奨される php.ini 設定
   | 
   |-php4ts.dll           -- コア PHP DLL
   | 
   |-...

例2 PHP 5 パッケージ構造


c:\php
   |
   +--dev
   |  |
   |  |-php5ts.lib
   |
   +--ext                 -- PHP 拡張モジュールの DLL
   |  |
   |  |-php_bz2.dll
   |  |
   |  |-php_cpdf.dll
   |  |
   |  |-...
   |
   +--extras
   |  |
   |  +--mibs             -- SNMP 用サポートファイル
   |  |
   |  +--openssl          -- Openssl 用サポートファイル
   |  |
   |  +--pdf-related      -- PDF 用サポートファイル
   |  |
   |  |-mime.magic
   |
   +--pear                -- PEAR の初期コピー
   |
   |
   |-go-pear.bat          -- PEAR セットアップ用スクリプト
   |
   |-fdftk.dll
   |
   |-...
   |
   |-php-cgi.exe          -- CGI 実行ファイル
   |
   |-php-win.exe          -- コマンドプロンプトを開かずにスクリプトを実行する
   |
   |-php.exe              -- CLI 実行ファイル - コマンドラインでのスクリプト実行専用
   |
   |-...
   |
   |-php.ini-dist         -- デフォルトの php.ini 設定
   |
   |-php.ini-recommended  -- 推奨される php.ini 設定
   | 
   |-php5activescript.dll
   |
   |-php5apache.dll
   |
   |-php5apache2.dll
   |
   |-...
   |
   |-php5ts.dll           -- コア PHP DLL
   | 
   |-...

PHP 4 と PHP 5 とで、相違点もあり、共通点もあります。 双方とも、CGI 実行ファイル、CLI 実行ファイル、およびサーバモジュールがあります。しかし、フォルダや ファイル名が異なります。PHP 4 では、サーバモジュールは、 sapi フォルダ内にありますが、 PHP 5 ではそういったフォルダは無く、PHP を展開したフォルダのルートにあります。 PHP 5 の拡張モジュールが必要とする DLL も、別フォルダ内には納められていません。

注意: PHP 4 では、dll フォルダおよび sapi フォルダ内のすべてのファイルを メインのフォルダ(C:\php など)に 移動してください。

PHP 4 および PHP 5 で提供されているサーバモジュールは以下の通りです。

  • sapi/php4activescript.dll (php5activescript.dll) - ActiveScript エンジン。Windows アプリケーションに PHP を埋め込むことが可能

  • sapi/php4apache.dll (php5apache.dll) - Apache 1.3.x モジュール

  • sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x モジュール

  • sapi/php5apache2_2.dll - Apache 2.2.x モジュール

  • sapi/php4isapi.dll (php5isapi.dll) - ISAPI モジュール。 IIS 4.0/PWS 4.0 以降を始とした ISAPI 互換サーバ用

  • sapi/php4nsapi.dll (php5nsapi.dll) - Sun/iPlanet/Netscape 用サーバモジュール

  • sapi/php4pi3web.dll (PHP 5 では提供なし) - Pi3Web 用サーバモジュール

サーバモジュールは、CGI バイナリと比べ、パフォーマンスが非常に高く、 機能も追加されています。CLI 版は、PHP をコマンドライン用のスクリプトとして 使うためのものです。CLI 版について詳しくは PHP をコマンドラインから使用するの章を参照してください。

警告

SAPI モジュールは、バージョン 4.1 以降、顕著な改善が行われています。 一方、古いシステムにおいては、サーバエラーが発生したり、ASP 等のサーバモジュールが 落ちたりする可能性があります。

CGI バイナリ、CLI バイナリ、およびサーバモジュールのいずれも php4ts.dll (php5ts.dll) を必要とします。 PHP がこのファイルを見つけられるようにする必要があります。 探索順は、以下の通りです。

  • php.exe のコール元のフォルダ。SAPI モジュールを 使用している場合、WEB サーバのフォルダ (例、 C:\Program Files\Apache Group\Apache2\bin)

  • Windows の PATH 環境変数に登録されたフォルダ

php4ts.dll / php5ts.dll を有効に するには、[1] Windows のシステムフォルダにコピーする方法、 [2] WEB サーバのフォルダにコピーする方法、[3] PHP フォルダ (C:\php) を PATH 環境変数に登録する方法の3つの選択肢があります。メンテナンスを考慮すると、 3番目の環境変数に登録する方法をとるべきでしょう。こうすれば、将来の PHP の アップグレードが容易になります。PHP フォルダを環境変数に登録する方法に ついては、FAQ を参照して ください (また、コンピュータを再起動することを忘れないでください。 ログオフするだけでは不十分です)。

次のステップは、PHP の設定ファイル php.ini を正しく記述することです。 配布される zip ファイルには php.ini-distphp.ini-recommended の二つの ini ファイルが含まれています。 パフォーマンスとセキュリティの観点から最適化された初期設定がなされているので、 php.ini-recommended の使用を推奨します。 php.ini-dist から多くの点で変更が行われています。 ini ファイルには詳しくコメントが書かれているので、注意深く読んでみると良いでしょう。 たとえば、display_errorsmagic_quotes_gpcoff となっていたりします。 さらに、設定ファイルのセクションもよく読んで 各要素を自ら設定してみてください。 PHP は、デフォルトの ini ファイルの設定できちんと動作するとはいえ、 最高のセキュリティを達成したいならば、自ら手を動かして設定することが最善の方法です。 選んだ ini ファイルを、PHP がアクセスできるフォルダにコピーし、php.ini にリネームしてください。PHP は、実行時設定 の節で述べられている場所から php.ini を探します。

Apache 2 を使用する場合、PHPIniDir ディレクティブを使うのが最も簡単でしょう (Apache 2 へのインストール ページ参照。) 他の場合、PHPRC 環境変数を設定するのが良いでしょう。 詳しい方法については、こちらの FAQ エントリ で解説されています。

注意: Windows NT, 2000, XP または 2003 で NTFS を使用している場合、WEB サーバを 実行するユーザが、php.ini を読める権限があることを確認してください。

以下のステップは、必要に応じて行ってください。

  • php.ini ファイルを編集し、 doc_root に Web サーバーの ドキュメントルートを設定します(ただし、OmniHTTPd を使用する場合は編集しないこと。) 例えば、以下のように設定します。

    doc_root = c:\inetpub       // IIS/PWS の場合
    
    doc_root = c:\apache\htdocs // Apache の場合 
    

  • PHP の起動時に、必要な拡張モジュールがロードされるように設定します。セットアップの方法や、 ビルトイン済みのモジュールについては Windows 用拡張モジュール のセクションを 参照してください。PHP の新規インストールの場合は、まず PHP が拡張モジュールなしで正しく動作することを 確認してから、php.ini を変更して拡張モジュールを有効にするほうが賢明です。
  • PWS と IIS においては、browscap を 次のように指定することができます。 c:\windows\system\inetsrv\browscap.ini (Windows 9x/Me の場合)、 c:\winnt\system32\inetsrv\browscap.ini (NT/2000 の場合)、 c:\windows\system32\inetsrv\browscap.ini (XP の場合)。 browscap.ini の編集については、 FAQ を参照してください。

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



add a note add a note User Contributed Notes
マニュアルインストール
philmee95 at gmail dot com
27-Jul-2008 12:52
64 bit windows issues. PHP is 32 bit, and w3svc can only run under 32 or 64...not both. You will have to set 32 bit compat mode.
http://www.iisadmin.co.uk/?p=14
Raafat
16-Jun-2008 02:25
Thanks to the one who pointed to this address:
http://www.peterguy.com/php/install_IIS6.html

it took me 5 minutes to set it up.
supportatradiormidotcom
13-Mar-2008 02:44
Im running Win 2003 PHP 5 with the isapi.dll thanks to this sipmle tutorial hope it will help someone.Cerdit goes to Peterguy.

http://www.peterguy.com/php/install_IIS6.html

Follow the instructions, PHP install made easy
bill at onemeg dot com
20-Feb-2008 01:48
Your PHP.INI file is not required to be in the C:\WINDOWS folder in XP.  The trick is to make sure that the PHP.INI can be found.  If you fail to reboot after adding the PHP folder to the path and creating the PHPRC environment variable, the file will likely not be found.  If you can't reboot, then try creating the registry entries as described in the following document:

http://www.php.net/manual/en/configuration.php

When you execute "phpinfo();" pay special attention to the data returned in "Loaded Configuration File".  If it does not show a path and a the PHP.INI file name, the file is not being loaded.  The path of C:\WINDOWS in the Configuration File Path section is the default location where PHP looks for the INI file and does not mean that the file must be located there; in fact, the following document suggest that you leave the configuration file in the C:\PHP folder:

http://www.php.net/manual/en/install.windows.manual.php
ik2008 at sipvantage dot com
18-Jan-2008 10:34
In windows XP, the php.ini file must be in c:\windows directory. Or else most of the functions will work except mysql functions. The very first mysql command mysql_connect will fail with the following message "Call to unsupported or undefined function mysql_connect(); "
fgabrieli at gmail dot com
10-Jul-2007 06:55
Problem:
Error in my_thread_global_end(): 1 threads didn't exit

It seems that php 5.2.3 libmysql.dll does not work as expected, because Apache shows this error in the logs when we use mysql_*() functions

Solution:
I found it here:
http://forums.mysql.com/read.php?10,153077,155121#msg-155121

which is to replace 'libmysql.dll' file in your PHP installation directory (also in winnt/system32 if you copied it there) with the Dll from PHP 5.2.1

You can download the second one from here:
http://www.php.net/get/php-5.2.1-Win32.zip/from/a/mirror

Regards,
Fernando Gabrieli
sam b
29-Jun-2007 11:53
I ran across the same problem listed below, using IIS6 instead of Apache on Windows Server 2003.

It seemed that I could run a PHP script on the command line just fine, and lines such as:
<? if(function_exists("mysql_connect")) echo "MySQL is present."; ?>
ran without error, and printed as expected.

Loading the file via IIS (using Firefox from my Ubuntu workstation), it wouldn't print anything, indicating that the MySQL extension hadn't been loaded.

Fix: rename/delete all "libmysql.dll" except for the one in "C:\PHP\ext" or equivalent.

... Same fix as listed below, but I wanted to point out: it's relevant to IIS as well.
adozolj at yahoo dot com
28-Jun-2007 07:41
I got the 'Fatal Error: call to unindentified function mysql_connect()' and resolved it after many hours of troubleshooting. The problem has to do with the libmysql.dll file residing in multiple directories. It SHOULD only be in the php directory. So, erase the copy in mysql bin and the apache bin and restart apache. I hope this helps someone. if this doesn't help check out forums.mysql.com and search "Call to undefined function mysql_connect". (i got the solution to this problem from here)
Shivan at Freenet dot de
27-Jun-2007 11:57
I had the same problem on IIS6 with php 5.2.3, that I got a blank page and nothing more, but the phpinfo(); worked.

The cause wasn't the not-set doc_root, but after enabling "show errors" I got an error message, that my script used more than 8 MB... ;)

After enlarging memory it worked :))))
jussi dot korhonen at evtek dot fi
30-May-2007 02:27
With MySQL 5.0.41 & Apache/2.2.4 & PHP/5.2.2 on Windows XP SP2 php_mysql.dll failed to load. All configurations, including php extension dir and windows path seemed to be correct. After hours of tinkering, I found that my MySQL bin/-directory contained a libmysql.dll too.
Because MySQL bin/-directory was before c:\php-directory in PATH, PHP tried to use MySQL version of libmysql.dll and failed miserably. By putting c:\php in PATH before MySQL everything worked like a charm!
andyfrazer at gorillasites dot com
25-May-2007 08:18
I was trying to start Apache 2.2.4 using PHP5.2.2 on Windows XP. When I added the following command to the Apache httpd.conf file:

LoadModule php5_module "c:/php/php5apache2.dll"

Apache would not start. When I removed that command, it started fine.

Based on a suggestion in http://www.apachelounge.com/forum/viewtopic.php?t=570, I tried this instead:

LoadModule php5_module "c:/php/php5apache2_2.dll"

and it started up immediately.

I wasted two evenings trying to get this work before I found the link to the ApacheLounge forum. I hope this helps someone else.
dr dot juanc at yahoo dot com
18-Apr-2007 05:18
Installing PHP5.2.1 in IIS 6.0 bring me some troubles too.

First i need to use full tag to make it your php script works and second the IIS didn't want to load the extension in the ext folder. I cheked the configuration a couple of thousand of time and everything seen to be ok.

I fixed up given read access in the "ext" folder to de "IUSER/PCNAME" user or to everyone/PCNAME user to the same folder. Just in case i did the same in the rest of the folder inside the php folder.

I wish nobody loose an all day in the same thing, like me.

excuse my english please
shane
20-Mar-2007 12:17
IIS Windows 2003 server.

You have upgraded to PHP5 from PHP4. phpinfo- works fine. You cannot however communicate with mysql (for example) through phpMyAdmin as it throws up an error stating it cannot load the mysqli extension and/or you get the 'bad handshake' warning.

Solution: update your libmySQL.dll file in your system32 folder. This requires you to stop all internet services on your computer i.e IIS. Full details below.

#############################
Background: my server is set up as follows:

php files folder == C:\PHP
I have configured my php.ini file opening up the required extensions etc
I have mapped the necessary extension to IIS
I have configured my website extension(s)
I have mapped  my windows path ';C\PHP;C\PHP\ext'
I have registered my ini file
I have tested my phpinfo() and it works
I have installed phpMyAdmin and it refuses to work
I have tried simple mysql connection scripts ...nada
I have checked everything 50 times
I am bald.

Then I did this:

##############################

1) Copy 'libmySQL.dll' from C:\PHP (or the folder where you have loaded php into)

2) Open 'Windows\system32' folder. Do nothing at the moment, just have this window 'to hand'.

3)Open IIS manager snap in(control panel - administrative tools - IIS manager)

Right click server name as shown below:

- Internet Information Services
    - My Computer (local computer) - right click

Select 'all tasks' then 'Restart IIS...'
Use drop down then select 'stop internet services on XXXXX' and click 'OK'

4) Return to your 'Windows\system32' folder. Paste 'libmySQL.dll' (it is already in your clipboard from step 1). It will warn you about overwrite the current one. Select YES.

5) Return to IIS manager. Follow steps as in '3' above except now choose 'Restart Internet Services on XXX' (the default option), click OK.

#############################

I hope this works for you.
hkhasgiwale at gmail dot com
06-Feb-2007 08:26
I wasted a lot of time trying to figure out the problem of not being able to display my 'test.php' demo script to work, the file lay in my IIS 5 " C:\inetpub\wwwroot" folder.

The file contents of test.php were:
<?php>
phpinfo();
<
?>

Windows php installer version was 5.2.0

Problem lay in the minute dumb feature of windows explorer being used t change(rename) text file extension from 'test.txt' to 'test.php'.
The resultant name looked by the IIS was still 'test.php.txt'.

I used command line to change the filename to 'test.php' and it displayed in my browser.

http://localhost/test.php, worked right away.
simon at dna dot co dot nz
24-Jan-2007 12:42
I have found a lot of references to run the below script to test whether PHP is running:
<?
phpinfo
();
?>

Unfortunately this does not work with a php.ini based from php.ini.recommended as that has short tags turned off by default.
Use full tags, as recommended anyway, otherwise you will just get a blank page.

<?php
phpinfo
();
?>

This is probably real basic to php old timers but can easily catch us newbies.
Daniel
02-Dec-2006 07:11
Re: Manual Configuration, pathing errors in IIS and ISAPI setup

Chris @ 11-Oct-2006 and phpmanual at pbb dot dds dot nl @ 07-Oct-2004 are both correct.

Problem is not with PHP but with IIS (mine is v5.1).

Installed PHP into C:\Program Files\PHP, and set environment variable PATH to path as stated.

When selecting the installation of php5isapi.dll via IIS Administrator, IIS would insert the path as:

"C:\Program Files\PHP\php5isapi.dll" (note the quotes and space in directory name)

All scripts ran and produced a HTTP 500 error.

Replaced ISAPI path in IIS with:

C:\PROGRA~1\PHP\php5isapi.dll (note the removal of the quotes and spaces, and the replacement of the path with 8.3 format names)

All scripts ran w/o problems.

Thanks to all! I hope someone can report if a similar problem exists with IIS6/7.
Chris
12-Oct-2006 05:58
RE:  phpmanual at pbb dot dds dot nl  @ 07-Oct-2004 11:29

You are correct.  I just had the same issue; I was following the PHP installation instructions and some very helpful WIMP instructions.

I was trying to keep things tidy by putting my PHP directory in C:\Program Files\PHP.  I set the PATH variable, ISAPI filter config and extension in Application Configuration, but was getting the "Specified module could not be found" error.

Changed the PHP directory to C:\PHP and reconfigured everything, did an iisreset, and it started working immediately.

Good catch, and thank you!
mega-squall at caramail dot com
23-Jul-2006 12:19
Remember to enter FULL PATH in the extension_dir parameter in php.ini ! Using only "./ext/" or any relative path will have your PHP failing to load extensions when called by Apache. That's quite tricky 'cause extensions are working when PHP is used through command line ...
Jason Greene
04-May-2006 04:06
If you are running websites within an Application Pool (which is now the default for IIS6 under 2K3) you need to make sure that your PHP directory (e.g. C:\PHP) has read permissions for the user assigned to the Application Pool.

1. In the IIS snap-in, choose Application Pools
2. Right-click on DefaultAppPool (or other, if you have one defined) and choose Properties
3. Click the Identity tab
4. Make a note of the user name set as the security account for this application pool (e.g. "Network Service")
5. Browse to your PHP directory and grant that user read permissions for the entire directory.

In my case, I had to add permissions for the user "NETWORK SERVICE" to get PHP scripts to work. Otherwise I received 401/403 authorization errors when trying to load them in a remote browser.

Note also that first tried adding IUSR permissions to the PHP directory, but that had no effect.
Ben
07-Apr-2006 01:17
In the Note Titled "Windows Server 2003 (x64 bits) + IIS 6.0" in step 1 when adding your new .php extension, it will not work unless after you click on the "Home Directory" you make sure that your "Execute permissions:" are set to "Scripts Only".

By default, on my machine, the permissions were set to "None" not allowing php to run.

Also, for more security it might be wise to Add the new extension just to your default site instead of the whole Web Sites folder in IIS. This would only apply if you were hosting multiple sites and had a site you didn't want scripts to run on.
Tom
14-Feb-2006 07:54
On this page and the FAQ they point out that to reset the Windows PATH variable to include your php dir, you need to completely restart the machine.

If you can't afford to do that (installing on a live server for example), you can use the setx.exe tool from the Windows Resource Kit (google it). Like so:

c:\pathtoresourcekit> setx.exe PATH "%PATH%;c:\php" \m
Windows Server 2003 (x64 bits) + IIS 6.0
01-Feb-2006 01:16
1. Add new extension (.php)

    * Expand the local computer in the left pane
    * Right-click on "Web Sites" in the left pane, then click "Properties" in the menu that pops up
    * Flip top the "Home Directory" tab
    * Click "Configuration"
    * Flip to the "Mappings" tab
    * Click "Add..."
    * Enter the full path to php5isapi.dll in the "Executable" textbox (Browse... to find it more easily if you need to)
    * Enter ".php" in the "Extension" textbox
    * Select radial button "Limit to", enter "GET,POST,HEAD"
    * Click "OK" all the way out

2. Verify php5isapi.dll is allowed

You must verify that the versions of php5isapi.dll that you want to use are allowed.

   2.1. In Internet Information Services (IIS) Manager, in the left-hand column, click the Web Services Extensions node and verify php5isapi.dll is allowed and all other Web Service Extensions are prohibited.
   2.2. If the version of php5isapi.dll that you want to use does not appear in the list, follow the instructions to enable it and then repeat this procedure:

Go into IIS
Below all of the websites is a folder: Web Service Extensions
In blue, to the lower left, is a choice: Add A New Web Service Extension
Add PHP/PHP5ISAPI.dll
Choose To ALLOW it.

   2.3 If the version of php5isapi.dll you want to use appears on the list but is not allowed, right click the version of php5isapi.dll you want to allow and click Allow.

3. Configuring IIS for 32-Bit Emulation Mode (THIS IS MOST IMPORTANT!!!!)

3.1. If you are installing IIS on x64-based editions of Windows Server 2003 or Windows Server 2003 R2, IIS must be configured to run in 32 bit emulation mode. Perform the following procedure on each front-end Web server running an x64-based edition of Windows Server 2003.
Configure Internet Information Services (IIS) for 32-bit mode

   1. Click Start, and then click Run.
   2. In the Open box, type cmd, and then click OK.
   3. In the command prompt window, navigate to the %drive%:\Inetpub\Adminscripts folder, where %drive% is the drive in which Windows Server 2003 is installed.
   4. In the Adminscripts folder, type the following command:

      cscript adsutil.vbs set w3svc/AppPools/Enable32bitAppOnWin64 1

      Note  The value "1" for Enable32bitAppOnWin64 specifies 32-bit mode, whereas the value "0" specifies 64-bit mode.
   5. Press ENTER.
   6. Type iisreset and then press ENTER.
   7. Close the command prompt window.
   8. Re-star System.

Note  The Run WWW service in IIS 5.0 isolation mode check box is only selected if you have upgraded to IIS 6.0 on Windows Server 2003 from IIS 5.0 on Windows 2000. New installations of IIS 6.0 use IIS 6.0 worker process isolation mode by default.
patatraboum at nospam dot com
27-Dec-2005 04:09
IIS + PHP

- The browser can't find your php code like localhost/dir/dir_code.php from any virtual directory (404 error)
- You are sure the code exists
You may rename it with a .html extension and check if it displays
- Process of your php code like localhost/root_code.php is ok from the root directory

It may come from the doc_root directive in php.ini whitch should be set to blank :

doc_root =

Then restart IIS to reload php.ini
some dude @ some place
04-Nov-2005 06:57
on two recent installation attempts on iis6 on win2k3 i followed the php manual and windows configuration steps exactly and php would still not run.

on the first install i had to give the USER account (not IUSR) read execute permissions to this file, c:\php\sapi\php4isapi.dll. using filemon i saw that it was being accessed and access was denied.

steps:
- right click on this file > properties > security > add > location (select the server -not domain if listed) > advanced > find now > Users (usually the last item) > click OK
- select Read & Execute > apply

also a complete computer restart was required in each install
Bill dot Rook at Gmail dot com
18-Sep-2005 08:09
doc_root = ".;c:\inetpub\wwwroot" does seem to work with virtual websites. This might be a better option then commenting out the line.
Jason
10-Sep-2005 02:54
For me atleast, the steps for installing php 5 on IIS 6 on windows 2003 seemed to get buried with the other setups. I found it difficult to quickly look through and make sure I covered every step. So I created a clean step by step tutorial with screenshots:
http://psdforums.com/article.php?a=9
atomictaco at atomic-taco dot com
10-Jul-2005 07:17
In response to phpmanual at pbb dot dds dot nl:

You are absolutly correct.  I found this out while trying to install PHP4 with Apache2 on XPPro.  Here are 3 general guidelines that I have found to be correct:

- Path may not have spaces.  Change C:\Program Files to C:\Progra~1  If you don't understand this, go to start-->run-->command (not cmd).  Type cd\ and hit enter.  Then type dir.  You should see all your directory names there.

- Paths should not be enclosed by quotes.

- Use forward slashes (/) and not backslashes (\)
thierry dot bo at nxextxcxoxuxrxrxixexr dot com
20-Dec-2004 02:50
With PHP 4.3.x and apache 1.3.x on windows, PHPRC is used only if php is installed as cgi. With module, no matter using setenv in httpd.conf or PHPRC as windows environment variable, it is not used.
cpz at akik-ffm dot de
19-Dec-2004 08:24
In the above, "the web server's directory" means the directory where the server executable lives, for example for the Apache installation on my XP box this is "\program files\apache group\apache2\bin" and NOT just "\program files\apache group\apache2".

But it's probably best to tell your web server where PHP's ini file is stored, for example via PHPIniDir for Apache's http.conf.
mic42 at users dot sourceforge dot net
01-Dec-2004 06:09
To install PHP as CGI under the Tcl Webserver Tclhttpd follow the instructions at:
http://wiki.tcl.tk/12130
chuacheehow at gmail dot com
08-Oct-2004 03:55
My experience with IIS 5.1 is that the doc_root directive be commented in order for virtual directories to recognise PHP files (with PHP installed as CGI).
phpmanual at pbb dot dds dot nl
07-Oct-2004 04:29
Okay, I'm a total newbie to this, so my findings may be wrong, but this is what I found out.

The manual says "do not have spaces in the path (like C:\Program Files\PHP) as some web servers will crash if you do". Indeed, when using this with PHP5 on WinXP, I got the error message "The specified module could not be found."
However, the problem seems not to lie in the SPACE in the pathname, but in the QUOTES that Windows adds when a space is in the pathname! This is what I found:

"C:\Program Files\php5\php5isapi.dll" -- doesn't work
C:\php5\php5isapi.dll -- works
"C:\php5\php5isapi.dll" -- doesn't work
C:\Progra~1\php5\php5isapi.dll -- works
"C:\Progra~1\php5\php5isapi.dll" -- doesn't work
C:\Program Files\php5\php5isapi.dll -- doesn't work, because it's not accepted by Internet Information Services

I don't know if this all is a problem with Internet Information Services or with PHP, but it would be nice if it was more documented in the PHP manual.
php dot user dot com
29-Aug-2004 11:43
After having the same problem as specifed below with "No input file specified". I changed the doc_root as mentioned.

This is fine if all php scripts are going to be run from the c:\inetpub\wwwroot directory. To enable it for multiple websites where the root directories are all different simply leave the doc_root attribute in the php.ini file blank.

This is for the isapi version not cgi implementation. It also means you don't have to set IUSR or IWAM access to the PHP root directory.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites