View previous topic :: View next topic |
Author |
Message |
Jason Forum Fanatic
Joined: 19 Sep 2002 Posts: 16777215
|
Posted: Wed Nov 27, 2002 7:32 pm Post subject: PHP Support in IIS |
|
|
Hi,
What do you have to install to get PHP scripts to work in IIS?
Cheers,
J
|
|
Back to top |
|
|
b4rtm4n Trusted SF Member
Joined: 26 May 2002 Posts: 16777206 Location: Bi Mon Sci Fi Con
|
|
Back to top |
|
|
ThePsyko SF Mod
Joined: 17 Oct 2002 Posts: 16777178 Location: California
|
Posted: Wed Nov 27, 2002 11:32 pm Post subject: |
|
|
Personally I didn't like the installer - it installed it as a cgi module and I have had better luck (2k pro, IIS5) with the ISAPI module - I found that the instructions on page 40 of the PHP Bible were much more helpful than those that are included with the manual when doing a manual install - if you don't have it, hit Barnes and Noble & take a notepad.. it's 8 steps, about a page long...
|
|
Back to top |
|
|
Jason Forum Fanatic
Joined: 19 Sep 2002 Posts: 16777215
|
Posted: Fri Nov 29, 2002 2:50 pm Post subject: |
|
|
ThePsyko wrote: |
Personally I didn't like the installer - it installed it as a cgi module and I have had better luck (2k pro, IIS5) with the ISAPI module - I found that the instructions on page 40 of the PHP Bible were much more helpful than those that are included with the manual when doing a manual install - if you don't have it, hit Barnes and Noble & take a notepad.. it's 8 steps, about a page long... |
Thanks mate, sounds interesting.
Does anyone know where i can view a copy of this (free)?
Cheers,
J
|
|
Back to top |
|
|
ThePsyko SF Mod
Joined: 17 Oct 2002 Posts: 16777178 Location: California
|
Posted: Mon Dec 02, 2002 7:00 am Post subject: |
|
|
k.. but you owe me a beer
** taken from PHP Bible ***
(for NT/2000 & IIS)
1. Extract binary archive & place in c:\php folder (can actually be anywhere - I put mine in d:\int\php for example)
2. Copy the php.ini-dist file in the PHP folder, paste it into your Winnt directory and rename it php.ini. This file must exist first or the rest of the installation will fail!
3. Go to system32 directory and look for msvcrt.dll. if it doesn't exist, you'll need to copy it from the php directory. also copy the php4ts.dll into the system32 directory
4. Start the Microsoft Management Console aka Internet Service Manager.
5. Right -click the icon representing the web site you want to PHP enable & select properties. Click the ISAPI filters tab. Click add to add a new filter. Give the filter name as PHP and the location as c:\PHP\php4isapi.dll. You must do this entire step seperately for each site you want to run PHP>
6. Click the home directory tab. Check to make sure that the Execute permissions has been selected. Click Configuration. Click Add under application mappings.. Type c:\php\php4isapi.dll into the Exectuable box, type .php into the extension box, leave Method exclusions blank and check the Script Engine check box (IIRC these aren't exactly correct - at least not in IIS 5 but they are close enough
7. Stop and restart the WWW service
8. Open notepad, type <?phpinfo() ?> and save into doc root as info.php. Open that file in your web browser & if you see the info, PHP is working..
NOTE: I found that I needed to modify the ACLs on d:\int\php before I could get it working on my system...
|
|
Back to top |
|
|
Jason Forum Fanatic
Joined: 19 Sep 2002 Posts: 16777215
|
Posted: Mon Dec 02, 2002 5:55 pm Post subject: |
|
|
ThePsyko wrote: |
6. Click the home directory tab. Check to make sure that the Execute permissions has been selected. Click Configuration. Click Add under application mappings.. Type c:\php\php4isapi.dll into the Exectuable box, type .php into the extension box, leave Method exclusions blank and check the Script Engine check box (IIRC these aren't exactly correct - at least not in IIS 5 but they are close enough
|
I am a little cautious about giving execute permissions on the box. Is there any way around this? Does PHP Absolutly need "execute" permissions, or will scripting perms do the same job?
J
|
|
Back to top |
|
|
haydies Just Arrived
Joined: 19 Apr 2002 Posts: 0 Location: Hades
|
Posted: Tue Dec 10, 2002 12:46 am Post subject: |
|
|
You don't have to use the CGI methode, it works well as an IIS exstention. You can get it from the PHP web site. Thats how I have it working on my PC at home.
Its not totaly working how ever, it tends not to remove slashes properly some times and other odd bugs, but in saying that I have an old vertion that came with PHP from Scratch (book).
The CGI way is just pointless and resource hungery....CGI it self is garbage for a number of reasons but lets not get in to that To set up PHP on IIS read the instructions that come with the PHP stuff, its all there
From the Readme.txt that comes with PHP 4 for windows.
Requirements
------------
- Windows 95 or later, Windows NT 4.0 or later
- ISAPI 4.0 compliant Web server required for ISAPI module (tested on IIS 4.0,
PWS 4.0 IIS 5.0). IIS 3.0 is *NOT* supported; You should download and
install the Windows NT 4.0 Option Pack with IIS 4.0 if you want native PHP
support.
- Windows 95 requires the DCOM update, freely available from:
http://download.microsoft.com/msdownload/dcom/95/x86/en/dcom95.exe
Installation
------------
Unlike PHP 3, PHP 4 is divided into several components; Even when you use
PHP in its CGI mode, php.exe is no longer a standalone executable, and relies
on external DLLs for execution. For this reason, if you install php.exe as
a handler for your web server, you must make sure that the DLLs in the
distribution exist in a directory that is in the Windows PATH. The easiest
way to do it is to copy these DLLs to your SYSTEM (Windows 9x) or SYSTEM32
(Windows NT) directory, which is under your Windows directory.
The DLLs that need to be copied are MSVCRT.DLL (it may already exist in there)
and PHP4TS.DLL.
Installation Notes for IIS 4.0 and 5.0
--------------------------------------
- Install the DLLs as mentioned above.
- If you wish to change any defaults, copy either the php.ini-dist or
php.ini-optimized files into your Windows directory, and rename it to
'php.ini'. You can then modify any of the directives inside it.
- Start the Microsoft Management Console (may appear as
'Internet Services Manager', either in your Windows NT 4.0 Option Pack
branch or the Control Panel->Administrative Tools under Windows 2000).
- Right click on your Web server node (will most probably appear as 'Default
Web Server'), and select 'Properties'.
- If you don't want to perform HTTP Authentication using PHP, you can (and
should) skip this step. Under 'ISAPI Filters', add a new ISAPI filter.
Use 'PHP' as the filter name, and supply a path to the php4isapi.dll that
is included in the distribution.
- Under 'Home Directory', click on the 'Configuration' button. Add a new
entry to the Application Mappings; Use the path the php4isapi.dll as the
Executable, supply .php as the extension, leave 'Method exclusions', blank,
and check the Script engine checkbox.
- Stop IIS completely (you would have to stop the IIS Administration service
for that - stopping it through the Management Console isn't good enough;
You can do it by typing 'net stop iisadmin' on a command prompt).
- Start IIS again (you can do it by typing 'net start w3svc' on a command
prompt).
- Put a .php file under your Web server's document root and check if it works!
|
|
Back to top |
|
|
ThePsyko SF Mod
Joined: 17 Oct 2002 Posts: 16777178 Location: California
|
Posted: Tue Dec 10, 2002 8:02 am Post subject: |
|
|
What? no 'execute'? you'd be no fun to hax0r I tweked my perms too and haven't had a problem at all..
installed php to d:\int\php
web server is running @ d:\dev\web\wwwhoot (note not wwwroot
on the wwwhoot folder, the ACLs are set with me having full control (duh), with the Everyone group along with IUSR and IWAM having rx only ( wait, one of the IIS accounts (not about to go dig out sid2user atm - can create files / folders and write / append data ). I haven't modified these after running the IIS Lockdown tool I don't believe.
As for PHP.. I removed the 'Everyone' group and replaced it with 'Authenticated Users'.. but have't had any problems
|
|
Back to top |
|
|
|