• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

PHP Support in IIS

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Wed Nov 27, 2002 7:32 pm    Post subject: PHP Support in IIS Reply with quote

Hi,

What do you have to install to get PHP scripts to work in IIS?

Cheers,

J
Back to top
View user's profile Send private message Send e-mail
b4rtm4n
Trusted SF Member
Trusted SF Member


Joined: 26 May 2002
Posts: 16777206
Location: Bi Mon Sci Fi Con

Offline

PostPosted: Wed Nov 27, 2002 8:55 pm    Post subject: Reply with quote

http://www.php.net/get_download.php?df=php-4.2.3-installer.exe

This is probably a good place too start! Wink
Back to top
View user's profile Send private message Send e-mail
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Wed Nov 27, 2002 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Fri Nov 29, 2002 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Mon Dec 02, 2002 7:00 am    Post subject: Reply with quote

k.. but you owe me a beer Laughing

** 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 Smile

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
View user's profile Send private message Send e-mail
Jason
Forum Fanatic
Forum Fanatic


Joined: 19 Sep 2002
Posts: 16777215


Offline

PostPosted: Mon Dec 02, 2002 5:55 pm    Post subject: Reply with quote

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 Smile


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
View user's profile Send private message Send e-mail
haydies
Just Arrived
Just Arrived


Joined: 19 Apr 2002
Posts: 0
Location: Hades

Offline

PostPosted: Tue Dec 10, 2002 12:46 am    Post subject: Reply with quote

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 Smile To set up PHP on IIS read the instructions that come with the PHP stuff, its all there Smile

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
View user's profile Send private message Visit poster's website
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Tue Dec 10, 2002 8:02 am    Post subject: Reply with quote

What? no 'execute'? you'd be no fun to hax0r Smile 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 Smile

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 Smile - 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 Smile
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Looking for more Windows Networking info?

Sign up to the WindowsNetworking.com Monthly Newsletter, written by Enterprise Security MVP Deb Shinder, containing news, the hottest tips, Networking links of the month and much more. Subscribe today and don't miss a thing!
View a sample newsletter.

Become a WindowsNetworking.com member!

Discuss your Windows Networking issues with thousands of other Windows Newtorking experts. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred data recovery solution?

Follow TechGenix on Twitter