Code Examples
  Home arrow Code Examples arrow Run PHP4b4 on IIS5
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

Run PHP4b4 on IIS5
By: Patrick Quinn-Graham
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating:  stars stars stars stars stars / 0
    2001-04-05

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Discussion on installing PHP on Win2k.[bold]Question:[/bold]Personally, I don't know what Edwin is talking about tags for.My little example: Cold Fusion:


    <CFIF variable1=variable2>
    <!--- Do 
    something --->
    <
    CFELSE>
    <!--- DO 
    something if it isnt a match --->
    </
    CFIF>

    Now, in PHP it would be


    <?
    if (
    $variable1==$variable2)

    // Do something
    } else

    // Do something if it isnt a match!
    }



    In ASP:


    <%
    IF (
    variable1 variable2then
    ' Do something
    Else
    Do something if it isnt a match
    End 
    If
    %>

    Now tell me that PHP is a tag based system!And its hard to add a "tag"? In CF each tag is a seperate "template".In PHP:


    <?
    function 
    newTag($NewTagVariable1) {
    // do whatever with $NewTagVariable1.
    // Anything you like.
    }


    In ASP:


    <%
    Sub newtag(NewTagVariable1)
    ' Do whatever with NewTagVariable1.
    Anything you like.
    End Sub
    %>

    PHP4 b4 comes with instruction in the readme file for setting up under PWS: You add it as a filter, and as a script engine.Here's what I did, In short:Copy PHP4TS.dll to %SystemRoot%\System32On a fresh install of Win2k the other required dll, msvcrt.dll is allreadythereand is newer so I wouldn't risk overwriting it :).Copy PHP.INI-DIST to %SystemRoot%\PHP.INI--> It should work straight out of the box, if you follow the guidelinesbelow.In Internet Services Manager,Expand the server you want, then right click on the WWW site you want PHP towork on: you can do this for more than one site of course.>From the right click menu, choose Properties.In the window that comes up, choose the ISAPI Filters tab, click Add...In the little dialog, tell it the path to PHP4ISAPI.DLL, which will bewherever you unpacked PHP to. (this ONLY applys to version 4.0 and above.There is no ISAPI mode of v3 as far as I know).Give it the name of PHP.Once you've done that, and clicked OK, change to the tab "Home Directory",Look around the "Application Settings" label. Around that area you will seea button labeled "Configuration". Click it!In the window that pops up, click add. In the executable field, tell itwhere the PHP4ISAPI.dll file is. (if you have v3, and not v4, point it tophp.exe at this stage).Tell it what extension to use. PHP or PHTML are common. (You do NOT need the. before the extension).Verbs: All Verbs.Script Engine: Yes.Check that file exsists: Up to you, I guess. Will either let IIS generatethe 404, or PHP give users a "No Input File Specified".... I urge you chooseyes :)Click ok. You will need to repeat this step for each file extension you wantPHP to work with!You then need to completely stop IIS. You can do this by "net stop iissvc"from the command prompt (under win2k I get this by running cmd.exe).>From the command prompt type "net start w3svc".Now return to Internet Services Manager, and start each of the servicesagain.Now make a page like page.php in the root of your site (of course replacethe .php with an extension that setup to work with PHP!), and just putsomething simple likeIn the file. This also tells you what you are telling every site you visit:).This is a bit more wordy than the PHP readme, but hey it worked onIIS5/WIN2k, and IIS4/WinNT4Server.[bold]PHP AND IIS(Internet Information Server).[/bold][bold]We posted an article on PHP and IIS: Received some good emails on this so this was too good of information not to share with our users. Here is the article that showed on 1/5/2000PHP Beta 4.0 is out[/bold]PHP is available for free from:http://www.php.net/downloads/ Currently the ver.4 beta is out and i've downloaded it.PHP is just like ASP-the server side language(?) with a lot of tags.Though it is occasionally creating errors while using in win NT,it is being tuned to avoid them.An SQL Server called MySQL also acts as a parallel thing ,available at http://www.mysql.com/downloads. After answering a few questions,you can get a trial version for it.[bold]Running PHP under IIS link[/bold]Received a post in the Forum asking this question. Not knowing PHP too well, went searching and didn't find anything. The old faithful hotbot.com pointed me to the link below! Thought we'd share it with our fellow developers!. Came up with a link to check out. Anyone that has or know of anyone that has run PHP under IIS let us know. webmaster@aspfree.com. Glad to share this information further! [italic][bold]The disclaimer I've never tried PHP under IIS but it these links show what to do! We take no responsiblity though if something breaks! :))[/bold][/italic]Here is the link to check out! Installing PHP on Windows95/NThttp://udb.feld.cvut.cz/docs/php3.old/installation02.htmlHere are the emails and responses. If you have one let us know. soundoffbbs@aspfree.comReceived an Email 1/11/2000Hi there,I am currently running PHP on Windows NT with IIS 4 installed. We use it on our Intranet server. I am also running MySQL database with IIS without any problems so far.The following is an extract of the readme.txt file, which gives the correct procedure (located in the php directory). I followed the procedure, configured IIS the same way as you would for ASP and have been playing around without any hassle!Basically you need to put your ini file (which you have to rename yourself into the correct directory for Win 95/98 or NT:(typicaly c:\windows or c:\winnt) <> rename the file php_iis_reg.inf for thisAfter that you need only to configure IIS.registry entries for PWS & IIS:HKEY_LOCAL_MACHINE:System\CurrentControlSet\Services\W3Svc\Parameters\Scri pt Map.php3 "c:\php3\php.exe %s %s"******************************************************************* If you have used the setup program, and have IIS or PWS, you are almostready to go. You must first decide which directories in your web serverwill contain php scripts, and make those directories executable. You will need to manualy edit configurations for other web servers. Otherwise, you can follow the instructions below for installation. ----------------------------------------------------------------------An INF file (php_iis_reg.inf) has been included that will automaticaly add registry settings forIIS 3 and PWS.registry entries for PWS & IIS:HKEY_LOCAL_MACHINE:System\CurrentControlSet\Services\W3Svc\Parameters\Scri pt Map.php3 "c:\php3\php.exe %s %s"As more server specific information is gathered, more registry entries maybe added.NOTE: I have not been able to get php to work correctly with PWS 4 ----------------------------------------------------------------------INSTALLATIONMake a directory, such as c:\php3, and place all the rest of the dlls there.If you are not using Apache NT server, you can set an environmentvariable in your autoexec.bat file, add this line:SET PHPRC=\windows\php3.iniand place your php3.ini file in whatever directory you specify.Otherwise, be sure to place php3.ini in your os directory(typicaly c:\windows or c:\winnt).msql1.dll, calendar.dll and msql2.dll must be located in thesame directory as php3.exe, or you must specify where these filesare located either in your php3.ini file, or in the php3 script.Notes on IIS4 --------------------Start Internet Service ManagerRight click on the website you are installing php inSelect propertiesClick on the TAB "Home Directory"Select 'Script' under permisionsClick on button 'Configuration'Click on button 'Add'Executable should be c:\php3\php.exe %s %s (Yes, TWO %s's acording to M$ docs)Extension .php (or whatever you use)Check 'Script Engine'Click on OKClick on OK again.Stop then Start the web server.PHP should now work. If it doesn't verify the 'everyone' has full access to thedirectory c:\php3 and everything within it.Try running a simple script such as *********************************************************************Hope this was what you were looking for.Kind regards,MariMari.Bester@ixchange.com Received from EmailPHP is more like ColdFusion where you have a lot of TAGS (Server Side)instead of using components.There is no clear advantage of using PHP over ASP. In the future, when PHPgains more ground on NT this may be different (in term of cross-platformdevelopment).PHP is very popular in APACHE environments. While it does run under otherWebservers, it is cleary made to fit with this Webserver. You have even tagsspecially for APACHE.At this moment PHP includes support for ODBC databases, MSQL (I believe theydon't mean the Microsoft SQL), MYSQL (open source database popular underUNIX), PDF, XML, LDAP, IMAP, SMTP and file objects. In total some 300 tags(a lot of the tags go into the PDF support). Creating your own tags (e.g.fileupload, authentication, encryption etc) is hard to do.PHP lacks the full range of development tools you have for ASP.If this is the right moment to start a message board on PHP I don't know. Ithink, if you start one, you benefit more the Linux/UNIX developers usingAPACHE and PHP than NT developers. Don't think there is much deployment ofPHP under NT at this moment.
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Code Examples Articles
    More By Patrick Quinn-Graham

     

    IBM® developerWorks developerWorks - FREE Tools!


    Be the first to hear about i5/OS V6R1!

    Hold your calendar on January 30, 2008 for this free webcast on the new i5/OS. Rational's Enterprise Modernization products will be discussed at this webcast as they help to drive the application development environment for this new System i OS. <br />And learn how i5/OS will take you to the next step of efficient, resilient business processing. You will hear about the new i5/OS capabilities as it will be the most significant i5/OS release in years. If you cannot join the webcast on 1/30/08 you can still use this link to listen to the replay.<br />
    FREE! Go There Now!


    IBM DB2 Deep Compression ROI Tool

    The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times.
    FREE! Go There Now!


    NEW! Download DB2 Express-C 9.5

    Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages.
    FREE! Go There Now!


    NEW! Improve your build process with IBM Rational Build Forge, Part 2: Automate builds for a real-world Tomcat project

    Learn how Rational Build Forge can extend a simple compile and package build process by adding customization and deployment capability. Go from a manual method to automating: checking for code changes; getting the latest source; compiling and packaging; customizing; copying to and restarting a deployment server; and sending e-mail notification that a new version is available.
    FREE! Go There Now!


    NEW! Innovate don't duplicate! Asset reuse strategies for success

    Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository.
    FREE! Go There Now!


    NEW! Rational Talks to You: Grady Booch on Architecture

    Join this Rational Talks to You teleconference on November 29 at 1:00 pm ET to participate in an interactive discusssion with Grady Booch around architecture and reuse. Get your questions answered!
    FREE! Go There Now!


    NEW! Using Rational Business Developer to enhance your developer productivity

    Join this Rational Talks to You teleconference, to hear how Enterprise Generation Language (EGL) eliminates the need for tedious and error-prone low level coding, so developers can focus on business requirements. EGL extends the Rational software development platform with a simplified programming language that enables developers who have little or no experience with Java, Web technologies or Service Oriented Architecture, to create enterprise-class applications and services quickly and easily. It also allows developers who may have little or no mainframe programming experience to quickly create traditional mainframe components.
    FREE! Go There Now!


    NEW! Webcast: Quickly provide customized, integrated user interfaces with Lotus Notes 8

    IBM Lotus Notes 8 provides a wide range of developers the ability to provide customized, integrated user interfaces via composite applications and via custom sidebar and toolbar plug-ins. This webcast provides you with tips and techniques to use with out-of-the-box capabilities of Lotus Notes 8, and survey how you can share useful components within your own company and within a larger community.
    FREE! Go There Now!


    NEW! Whitepaper: Achieving consistency between business process models and operational guides

    Explore how Rational and WebSphere software enable enterprise documentation in SOA environments. Specifically, a new integration between IBM WebSphere® Business Modeler and IBM Rational® Method Composer software can help technical writers more easily keep enterprise operations manuals in sync with changes that are made to business processes, resulting in more accurate and timely documentation that benefits the entire enterprise.
    FREE! Go There Now!


    Refresh! IBM Rational Systems Development Solution eKit

    With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    CODE EXAMPLES ARTICLES

    - Handling Animations and Bitmaps Using GDI+ f...
    - Download a Web Page using the WebClient
    - Creating a Chart using Data from a Database ...
    - The Basics of Charting with the MS Chart Con...
    - Searching Body Text with textRange: Enter th...
    - Searching Body Text with textRange: Building...
    - Searching Body Text with textRange, part 1: ...
    - First Steps in Programming
    - Programming in C
    - Quick Introduction to ASF,ASX, and Networkin...
    - SatView: Pointer Perfect, Part 2: Constructi...
    - SatView: Pointer Perfect, Part 1
    - Style Case Studies: Construction Unions
    - Creating an Engine for Games for Windows
    - Style Case Studies: Generic Callbacks





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT