|
|
 |
Chapter 6. Installation on Windows systems
This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP
will not work on 16 bit platforms such as Windows 3.1 and sometimes
we refer to the supported Windows platforms as Win32. Windows 95
is no longer supported as of PHP 4.3.0.
There are two main ways to install PHP for Windows: either
manually
or by using the installer.
If you have Microsoft Visual Studio, you can also
build
PHP from the original source code.
Once you have PHP installed on your Windows system, you may also
want to load various extensions
for added functionality.
| Warning |
There are several all-in-one installers over the Internet, but none of
those are endorsed by PHP.net, as we believe that the manual installation
is the best choice to have your system secure and optimised.
|
The Windows PHP installer is available from the downloads page at
/downloads.php. This
installs the CGI version of PHP and for IIS, PWS,
and Xitami, it configures the web server as well. The installer does not
include any extra external PHP extensions (php_*.dll) as you'll only find
those in the Windows Zip Package and PECL downloads.
Note:
While the Windows installer is an easy way to make PHP work, it is
restricted in many aspects as, for example, the automatic setup of
extensions is not supported. Use of the installer isn't the preferred
method for installing PHP.
First, install your selected HTTP (web) server on your
system, and make sure that it works.
Run the executable installer and follow the instructions provided by the
installation wizard. Two types of installation are supported - standard,
which provides sensible defaults for all the settings it can, and advanced,
which asks questions as it goes along.
The installation wizard gathers enough information to set up the php.ini
file, and configure certain web servers to use PHP. One of the web servers
the PHP installer does not configure for is Apache, so you'll need to
configure it manually.
Once the installation has completed, the installer will inform you if you
need to restart your system, restart the server, or just start using PHP.
| Warning |
Be aware, that this setup of PHP is not secure. If you would like to have
a secure PHP setup, you'd better go on the manual way, and set every
option carefully. This automatically working setup gives you an instantly
working PHP installation, but it is not meant to be used on online servers.
|
User Contributed Notes
Installation on Windows systems
donald at netriver dot net
04-May-2005 04:21
On the Windows 2003 & IIS6 platform, you can run different websites on different versions & copies of PHP. This is useful in at least two cases:
1. You want one website on your box to have register_globals on, but since you're running IIS, you cannot specify that in an .htaccess file. And you definately don't want register_globals on for the rest of the websites.
2. You want to run different versions of PHP for different websites, or even just different extensions. Say you wanted one site to use 4.0.5 and a different site to use 4.1.11.
Its simple, just:
1. Move your php.ini file from your c:\windows\ directory directly to your php directory (by default that would be c:\php\)
2. Make sure you don't have a php.ini file in any other location that would supercede the c:\php\php.ini file. Using phpinfo(); is useful here.
3. Have your alternate version of php (either a different version or a different php.ini) have its own install directory, like c:\php4RG\ or c:\php405\.
4. In the Home Directory Configuration for your website, specify the .php extension to use a different script, pointing it at the alternate directory.
gary at garyslittlecompany dot com
26-Apr-2005 04:57
php compiled with eapi on windows. Spend hours trying to find something that would work for the
"Loaded DSO /..../php4apache.dll uses plain 1.3 API, this module might
crash under EAPI! (please recompile it with -DEAPI)".
Finally compiled it.
If you would like the binaries or instructions on how I did it email me.
Gary
John Kerner
20-Apr-2005 06:23
doyouunderstand at gmail dot com
03-Mar-2005 07:31
For those having trouble installing PHP 5+ ISAPI for IIS 6 (on Windows 2003 server), who have tried everything on this site and all over the net, with no success (like I did) - try the following before throwing your server out of a 3rd story window.
http://www.benmardesign.com/IIS_PHP_MYSQL_setup/php_setup.html
It was the only thing that worked out of all the many solutions I tried.
Probably some other solutions would've worked as well, but in my frusterated state of mind, this explanation was the clearest.
My problem was that in addition to adding the the Web service extension, I was not adding the ISAPI extensions for the websites in IIS Manager manaully. ALSO, remember to reboot after the changes on the site listed above. It's the only thing he forgot to mention, and depending on your setup, you may need to reboot to register the dll moves and changes made. (IIS restart will not re-register dlls).
Steve N
02-Feb-2005 11:33
Just a note following on from Luis D regarding adding the pgp4ts.dll as a Web Server Extension.
I just used the latest php-4.3.10-installer.exe from php.net and had the problems where .php files could not be found.
In order to get them to work I added and allowed the php.exe as a Web Service Extension and not the php4tx.dll.
Cheers,
Steve
claudio_jvt at hotmail dot com
14-Jan-2005 07:38
One very helpfull note to Win2003 iis6 users:
If you'd like to use isapi in the web service extensions and you're in a development server (or even if your php.ini config file changes frequently), here's what you can do:
Php.ini runtime changes:
Create a new application pool in iis:
iis->select server->application pools->new application pool
Use default settings;
go to the application pool you've created, properties->
check the "Recycle worker process" option, and give it a small value (10 is nice :) ).
Now go to your site (or virtual directory site)-> properties->
change the application pool to the newly configured appPool.
At this moment, is good to make a iss restart (note this is the only resart needed).
Your site is now semi-runtime changed :)
You can try it with the usal php info() test. Change something in the php.ini and check the number of requests it takes to use the new configuration.
The downside of this approach (wich is still better than to use php-cgi.exe): the process is recycled, so all the configuration in php.ini is read every N requests - with php-cgi.exe, this would happen for every request, so.. is a good solution.
Again, be carefull when using this in a production environment, since the load can increase (not sure how much, but it will certainly increase).
And keep in the new appPool JUST the php sites that require runtime changes in php.ini !
------
You've helped me, so I help you ;)
Tks
chris at move dash media dot com
09-Jan-2005 07:39
Note to windows users, if you are trying to install php5 ISAPI on windows server 2003 / IIS and getting a 404 when you try to view a simple php script, even though everything else seems to be right... click into "web service extensions" from IIS and either add a new web service extension, or click onto "all unknown ISAPI extensions" and click allow.
junji at go-dcraft dot com
23-Dec-2004 12:18
DO NOT USE the all in one installers like install all Apache, PHP, MySQL; and have them configure it automatically. well it maybe cool to others but its not fast enough for me, it took about a few minutes or two to load up the page, but when i uninstalled everything and reinstalled Apache, MySQL, PHP, manually everything seems to be smooth now.
i've used php before it is just now that i'll be using it intensively, if you'd just follow the manual instructions well, you'd be fine. i'm using XP SP2 so far everything is going well.
ntadmin at aplus dot net
27-Aug-2004 02:53
When configuring application pools with configurable
accounts instead of NETWORK SERVICE or LOCAL SYSTEM
remember to add the user to the correct security contexts found here:
Note: Watch for wordwrap
http://www.microsoft.com/resources/documentation/
WindowsServ/2003/standard/proddocs/en-us/Default.asp?
url=/resources/documentation/WindowsServ/2003/standard/
proddocs/en-us/sec_acc_wpenable.asp
Otherwise you will recieve 403 errors.
Sean Boulter
15-Apr-2004 05:00
This fixes the "The directory name is invalid" error.
In IIS 5.1 on Windows XP Pro, Go into the Internet Information Services, and into the properties of the virtual directory where the problem occurs. On The 'Virtual Directory' tab, click on the 'Configuration...' button. Select the '.php' extension, and press 'Edit'. On the bottom, Check the 'Check that file exists' checkbox.
Luis D
27-Mar-2004 07:49
This is just to clarify on a posting on this page that states the nescesity of allowing all unknown cgi Extensions in Windows 2003 IIS 6. Although this will work and it should be consider as a quick option for an itranet solution with no web access at all.
This poses a very serious security problem and its not the best course of action, in my opinion. The proper way of making this work will be to actually enable the extension that you want to execute. After verifying that the .php extension is present, simply go to "Web Service extensions" in the IIS Manager and click on "Add a new web service extension";
Once the "new web service extension" opens:
1- Add the "extension name" field, please enter "PHP" (or what ever you wanna call it) Other more conservative admins will say call it what it is and always input ".php". Its up to you!
2-Click on the "add" button and browse to the php4ts.dll file on your c:\PHP (default) and then click open --> OK and set the checkmark under "set extension status to allowed" click OK and thats it!!!
If you missed the checkmark moment cause you are just so impatient, like me, then simply select the extension on the web service extensions windows and click ALLOW.
This is a very simple process and it will work everytime.
I hope this helps, as I have found several things in this forums that are incredibly helpfull!!
PS: For the non programmer, it is a good practice to install mysql and a free php forum like bb2 to test how well your php IIS and mysql is working.
brian at schau dot com
09-Mar-2004 08:57
ferchland at computer-kontor dot de
06-Feb-2004 11:51
If need a php4apache.dll compiled with EAPI _and_ you run Apache with mod_ssl, use the Apache from
http://hunter.campbus.com/
This is already a binary for win32, but the *.lib and headers are included.
ungdi at hotmail dot com
21-Jan-2004 04:36
Under a Windows 2003 and IIS 6.x installation of PHP, it is interesting to note that by default in most cases, the "DefaultAppPool" for the "Default Web Site" is running under the security context of "Network Service" which maybe too restrictive. This results in a 403: Forbidden error every time you try to access a PHP page.
You have several options to remedy the problem:
an obvious one is to make it run as the "Local System", but that may be too much power for some administrators' tastes.
The other option is at the IIS Manager,
go to the computer's "Application Pools" folder,
and go to the properties dialog box of the "DefaultAppPool",
and then to the "Identity" tab, and select the "Configurable" identity of "IWAM_[COMPUTER_NAME]" as the security context. This will make the application pool run the way it did in the previous versions.
This solved the repeated problems of the 403 errors. However, do not forget to give permission to "IUSR_[COMPUTER_NAME]" and "IWAM_[COMPUTER_NAME]" appropriate directory permissions for your web directories as stated above.
yellowducklings at hotmail dot com
14-May-2003 11:29
spf at users dot sf dot net
19-Aug-2002 11:55
To allow acWEB.sf.net win32-webserver and Eserv 2.98 (www.eserv.ru) web-server run PHP 4.2.2 without problems with FORCE_REDIRECT you should set "cgi.force_redirect = Off" in php.ini in windows directory.
adam dot swick at pantellos dot com
15-Mar-2002 12:36
IIS 5: If you change the application mappings for PHP (for example, from CGI to ISAPI module), reboot after the change is made. The PHP Application Mapping change may cause a conflict if ISAPI applications are cached.
mike at schild dot com
01-Aug-2000 01:44
It's a hard way to get work php on win98/PWS... but with this comment-page I found it out how it works:<br>
- error 403: give read/write rights to the directory. You can do this by clicking the right mouse key on the directory in the explorer.<br>
- html file in a dos box: 1) clean the "doc_root" line in the php.ini file. 2) start personal web-manager / go to 'advanced' / make for your web-default-directory a virtual directory with all possible rights.<br>
On my system it works now!
| |