Introduction To PHP

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 108

http://www.php.net/manual/en/tutorial.php Chapter 1.

Introduction
Table of Contents What is PHP? What can PHP do?

What is PHP?
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open ource !eneral-purpose scriptin! lan!ua!e that is especially suited for We" development and can "e em"edded into H#$%& imple answer' "ut what does that mean? (n example: E ample 1!1. "n introductor# e ample

<html> <head> <title>Example</title> </head> <body> <?php echo "Hi, I'm a PHP script!"; ?> </body> </html>
)otice how this is different from a script written in other lan!ua!es li*e Perl or + -- instead of writin! a pro!ram with lots of commands to output H#$%' you write an H#$% script with some em"edded code to do somethin! (in this case' output some text)& #he PHP code is enclosed in special start and end ta!s that allow you to ,ump into and out of "PHP mode"& What distin!uishes PHP from somethin! li*e client-side -ava cript is that the code is executed on the server& .f you were to have a script similar to the a"ove on your server' the client would receive the results of runnin! that script' with no way of determinin! what the underlyin! code may "e& /ou can even confi!ure your we" server to process all your H#$% files with PHP' and then there0s really no way that users can tell what you have up your sleeve& #he "est thin!s in usin! PHP are that it is extremely simple for a newcomer' "ut offers many advanced features for a professional pro!rammer& 1on0t "e afraid readin! the lon! list of PHP0s features& /ou can ,ump in' in a short time' and start writin! simple scripts in a few hours& (lthou!h PHP0s development is focused on server-side scriptin!' you can do much more with it& 2ead on' and see more in the What can PHP do? section' or !o ri!ht to the introductory tutorial if you are only interested in we" pro!rammin!&

What can PHP do?


(nythin!& PHP is mainly focused on server-side scriptin!' so you can do anythin! any other +3. pro!ram can do' such as collect form data' !enerate dynamic pa!e content' or send and receive coo*ies& 4ut PHP can do much more& #here are three main areas where PHP scripts are used&

erver-side scriptin!& #his is the most traditional and main tar!et field for PHP& /ou need three thin!s to ma*e this wor*& #he PHP parser (+3. or server module)' a we"server and a we" "rowser& /ou need to run the we"server' with a connected PHP installation& /ou can access the PHP pro!ram output with a we" "rowser' viewin! the PHP pa!e throu!h the server& (ll these can run on your home machine if you are ,ust experimentin! with PHP pro!rammin!& ee the installation instructions section for more information& +ommand line scriptin!& /ou can ma*e a PHP script to run it without any server or "rowser& /ou only need the PHP parser to use it this way& #his type of usa!e is ideal for scripts re!ularly executed usin! cron (on 5nix or %inux) or #as* cheduler (on Windows)& #hese scripts can also "e used for simple text processin! tas*s& ee the section a"out +ommand line usa!e of PHP for more information& Writin! des*top applications& PHP is pro"a"ly not the very "est lan!ua!e to create a des*top application with a !raphical user interface' "ut if you *now PHP very well' and would li*e to use some advanced PHP features in your client-side applications you can also use PHP-3#6 to write such pro!rams& /ou also have the a"ility to write crossplatform applications this way& PHP-3#6 is an extension to PHP' not availa"le in the main distri"ution& .f you are interested in PHP-3#6' visit its own we"site&

PHP can "e used on all ma,or operatin! systems' includin! %inux' many 7nix variants (includin! HP-78' olaris and Open4 1)' $icrosoft Windows' $ac O 8' 2. + O ' and pro"a"ly others& PHP has also support for most of the we" servers today& #his includes (pache' $icrosoft .nternet .nformation erver' Personal We" erver' )etscape and iPlanet servers' Oreilly We"site Pro server' +audium' 8itami' OmniH##Pd' and many others& 9or the ma,ority of the servers PHP has a module' for the others supportin! the +3. standard' PHP can wor* as a +3. processor& o with PHP' you have the freedom of choosin! an operatin! system and a we" server& 9urthermore' you also have the choice of usin! procedural pro!rammin! or o",ect oriented pro!rammin!' or a mixture of them& (lthou!h not every standard OOP feature is implemented in PHP :' many code li"raries and lar!e applications (includin! the P;(2 li"rary) are written only usin! OOP code& PHP < fixes the OOP related wea*nesses of PHP :' and introduces a complete o",ect model& With PHP you are not limited to output H#$%& PHP0s a"ilities includes outputtin! ima!es' P19 files and even 9lash movies (usin! li"swf and $in!) !enerated on the fly& /ou can also output easily any text' such as 8H#$% and any other 8$% file& PHP can auto!enerate these files' and save them in the file system' instead of printin! it out' formin! a server-side cache for your dynamic content& One of the stron!est and most si!nificant features in PHP is its support for a wide ran!e of data"ases& Writin! a data"ase-ena"led we" pa!e is incredi"ly simple& #he followin! data"ases are currently supported: (da"as 1 .nter4ase Post!re =% d4ase 9ront4ase =%ite ;mpress m =% olid 9ilePro (read-only) 1irect $ - =% y"ase Hyperwave $y =% >elocis .4$ 14? O14+ 7nix d"m .nformix Oracle (O+.@ and O+.A) .n!res Ovrimos We also have a 148 data"ase a"straction extension allowin! you to transparently use any data"ase supported "y that extension& (dditionally PHP supports O14+' the Open 1ata"ase +onnection standard' so you can connect to any other data"ase supportin! this world standard& PHP also has support for tal*in! to other services usin! protocols such as %1(P' .$(P' )$P' ))#P' POPB' H##P' +O$ (on Windows) and countless others& /ou can also open raw networ* soc*ets and interact usin! any other protocol& PHP has support for the W118 complex data exchan!e "etween virtually all We" pro!rammin! lan!ua!es& #al*in! a"out interconnection' PHP has support for instantiation of -ava o",ects and usin! them transparently as PHP o",ects& /ou can also use our +O24( extension to access remote o",ects& PHP has extremely useful text processin! features' from the PO .8 ;xtended or Perl re!ular expressions to parsin! 8$% documents& 9or parsin! and accessin! 8$% documents' PHP : supports the (8 and 1O$ standards' and you can also use the 8 %# extension to transform 8$% documents& PHP < standardiCes all

the 8$% extensions on the solid "ase of li"xml? and extends the feature set addin! 8$%2eader support&

imple8$% and

While usin! PHP in the e-commerce field' you0ll find the +y"ercash payment' +y"er$7#' >eri i!n Payflow Pro and $+>; functions useful for your online payment pro!rams& (t last "ut not least' we have many other interestin! extensions' the mno3o earch search en!ine functions' the .2+ 3ateway functions' many compression utilities (!Cip' "C?)' calendar conversion' translation&&& (s you can see this pa!e is not enou!h to list all the features and "enefits PHP can offer& 2ead on in the sections a"out installin! PHP' and see the function reference part for explanation of the extensions mentioned here&

Chapter $. " simple tutorial


Table of Contents What do . need? /our first PHP-ena"led pa!e omethin! 7seful 1ealin! with 9orms 7sin! old code with new versions of PHP What0s next? Here we would li*e to show the very "asics of PHP in a short' simple tutorial& #his text only deals with dynamic we"pa!e creation with PHP' thou!h PHP is not only capa"le of creatin! we"pa!es& ee the section titled What can PHP do for more information& PHP-ena"led we" pa!es are treated ,ust li*e re!ular H#$% pa!es and you can create and edit them the same way you normally create re!ular H#$% pa!es&

What do I need?
.n this tutorial we assume that your server has activated support for PHP and that all files endin! in .php are handled "y PHP& On most servers' this is the default extension for PHP files' "ut as* your server administrator to "e sure& .f your server supports PHP' then you do not need to do anythin!& -ust create your .php files' put them in your we" directory and the server will automatically parse them for you& #here is no need to compile anythin! nor do you need to install any extra tools& #hin* of these PHPena"led files as simple H#$% files with a whole new family of ma!ical ta!s that let you do all sorts of thin!s& $ost we" hosts offer PHP support' "ut if your host does not' consider readin! the PHP %in*s section for resources on findin! PHP ena"led we" hosts& %et us say you want to save precious "andwidth and develop locally& .n this case' you will want to install a we" server' such as (pache' and of course PHP& /ou will most li*ely want to install a data"ase as well' such as $y =%& /ou can either install these individually or choose a simpler way& Our manual has installation instructions for PHP (assumin! you already have some we"server set up)& .n case you have pro"lems with installin! PHP yourself' we would su!!est you as* your Duestions on our installation mailin! list& .f you choose to !o on the simpler route' then locate a pre-confi!ured pac*a!e for your operatin! system' which automatically installs all of these with ,ust a few mouse clic*s& .t is easy to setup a we" server with PHP support on any operatin! system' includin! $acO 8' %inux and Windows& On %inux' you may find rpmfind and P4one helpful for locatin! 2P$s& /ou may also want to visit apt-!et to find pac*a!es for 1e"ian&

%our first PHP!enabled pa&e


+reate a file named hello.php and put it in your we" server0s root directory (DOCUMENT_ROOT) with the followin! content: E ample $!1. 'ur first PHP script: hello.php

<html> <head> <title>PHP Test</title> </head> <body> <?php echo '<p>Hello World</p>'; ?> </body> </html>
7se your "rowser to access the file with your we" server0s 72%' endin! with the "Ehello&php" file reference& When developin! locally this 72% will "e somethin! li*e http://localhost/hello.php or http://127.0.0.1/hello.php "ut this depends on the we" server0s confi!uration& .f everythin! is confi!ured correctly' this file will "e parsed "y PHP and the followin! output will "e sent to your "rowser:

<html> <head> <title>PHP Test</title> </head> <body> <p>Hello World</p> </body> </html>
#his pro!ram is extremely simple and you really did not need to use PHP to create a pa!e li*e this& (ll it does is display: Hello World usin! the PHP echo() statement& )ote that the file does ot eed to !e e"ec#ta!le or special in any way& #he server finds out that this file needs to "e interpreted "y PHP "ecause you used the "&php" extension' which the server is confi!ured to pass on to PHP& #hin* of this as a normal H#$% file which happens to have a set of special ta!s availa"le to you that do a lot of interestin! thin!s& .f you tried this example and it did not output anythin!' it prompted for download' or you see the whole file as text' chances are that the server you are on does not have PHP ena"led' or is not confi!ured properly& (s* your administrator to ena"le it for you usin! the .nstallation chapter of the manual& .f you are developin! locally' also read the installation chapter to ma*e sure everythin! is confi!ured properly& $a*e sure that you access the file via http with the server providin! you the output& .f you ,ust call up the file from your file system' then it will not "e parsed "y PHP& .f the pro"lems persist anyway' do not hesitate to use one of the many PHP support options& #he point of the example is to show the special PHP ta! format& .n this example we used $%php to indicate the start of a PHP ta!& #hen we put the PHP statement and left PHP mode "y addin! the closin! ta!' %&& /ou may ,ump in and out of PHP mode in an H#$% file li*e this anywhere you want& 9or more details' read the manual section on the "asic PHP syntax& " *ote on +ine ,eeds: %ine feeds have little meanin! in H#$%' however it is still a !ood idea to ma*e your H#$% loo* nice and clean "y puttin! line feeds in& ( linefeed that follows immediately after a closin! %& will "e removed "y PHP& #his can "e extremely useful when you are puttin! in many "loc*s of PHP or include files containin! PHP that aren0t supposed to output anythin!& (t the same time it can "e a "it confusin!& /ou can put a space after the closin! %& to force a space and a line feed to "e output' or you can put an explicit line feed in the last echoEprint from within your PHP "loc*& " *ote on Te t Editors: #here are many text editors and .nte!rated 1evelopment ;nvironments (.1;s) that you can use to create' edit and mana!e PHP files& ( partial list

of these tools is maintained at PHP ;ditors %ist& .f you wish to recommend an editor' please visit the a"ove pa!e and as* the pa!e maintainer to add the editor to the list& Havin! an editor with syntax hi!hli!htin! can "e helpful& " *ote on Word Processors: Word processors such as tarOffice Writer' $icrosoft Word and ("iword are not optimal for editin! PHP files& .f you wish to use one for this test script' you must ensure that you save the file as pla' te"t or PHP will not "e a"le to read and execute the script& " *ote on Windows *otepad: .f you are writin! your PHP scripts usin! Windows )otepad' you will need to ensure that your files are saved with the &php extension& ()otepad adds a &txt extension to files automatically unless you ta*e one of the followin! steps to prevent it&) When you save the file and are prompted to provide a name for the file' place the filename in Duotes (i&e& "hello.php")& (lternatively' you can clic* on the 0#ext 1ocuments0 drop-down menu in the 0 ave0 dialo! "ox and chan!e the settin! to "(ll 9iles"& /ou can then enter your filename without Duotes& )ow that you have successfully created a wor*in! PHP script' it is time to create the most famous PHP scriptF $a*e a call to the phpinfo() function and you will see a lot of useful information a"out your system and setup such as availa"le predefined varia"les' loaded PHP modules' and confi!uration settin!s& #a*e some time and review this important information& E ample $!$. -et s#stem information from PHP

<?php phpinfo(); ?>

.omethin& /seful
%et us do somethin! more useful now& We are !oin! to chec* what sort of "rowser the visitor is usin!& 9or that' we chec* the user a!ent strin! the "rowser sends as part of the H##P reDuest& #his information is stored in a varia"le& >aria"les always start with a dollar-si!n in PHP& #he varia"le we are interested in ri!ht now is (_)ER*ER+,HTT-_U)ER_./ENT,0& *ote: GH ;2>;2 is a special reserved PHP varia"le that contains all we" server information& .t is *nown as an auto!lo"al (or super!lo"al)& ee the related manual pa!e on super!lo"als for more information& #hese special varia"les were introduced in PHP :&I&J& 4efore this time' we used the older (HTT-_1_*.R) arrays instead' such as (HTT-_)ER*ER_*.R)& (lthou!h deprecated' these older varia"les still exist& ( ee also the note on old code&) #o display this varia"le' you can simply do: E ample $!0. Printin& a 1ariable ("rra# element)

<?php echo $_SERVER['HTTP_USER_AGENT']; ?>


( sample output of this script may "e:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)


#here are many types of varia"les availa"le in PHP& .n the a"ove example we printed an (rray element& (rrays can "e very useful& (_)ER*ER is ,ust one varia"le that PHP automatically ma*es availa"le to you& ( list can "e seen in the 2eserved >aria"les section of the manual or you can !et a complete list of them "y loo*in! at the output of the phpinfo() function used in the example in the previous section& /ou can put multiple PHP statements inside a PHP ta! and create little "loc*s of code that do more than ,ust a sin!le echo& 9or example' if you want to chec* for .nternet ;xplorer you can do this: E ample $!2. E ample usin& control structures and functions

<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { echo 'You are using Internet Explorer.<br />'; } ?>
( sample output of this script may "e:

You are using Internet Explorer.<br />


Here we introduce a couple of new concepts& We have an if statement& .f you are familiar with the "asic syntax used "y the + lan!ua!e' this should loo* lo!ical to you& Otherwise' you should pro"a"ly pic* up an introductory PHP "oo* and read the first couple of chapters' or read the %an!ua!e 2eference part of the manual& /ou can find a list of PHP "oo*s at E"oo*s&php& #he second concept we introduced was the strpos() function call& strpos() is a function "uilt into PHP which searches a strin! for another strin!& .n this case we are loo*in! for ,M)2E, (so-called needle) inside (_)ER*ER+,HTT-_U)ER_./ENT,0 (so-called haystac*)& .f the needle is found inside the haystac*' the function returns the position of the needle relative to the start of the haystac*& Otherwise' it returns FALSE& .f it does not return FALSE' the if expression evaluates to TRUE and the code within its K"racesL is executed& Otherwise' the code is not run& 9eel free to create similar examples' with if' else' and other functions such as strtoupper() and strlen()& ;ach related manual pa!e contains examples too& .f you

are unsure how to use functions' you will want to read "oth the manual pa!e on how to read a function definition and the section a"out PHP functions& We can ta*e this a step further and show how you can ,ump in and out of PHP mode even in the middle of a PHP "loc*: E ample $!3. 4i in& both HT4+ and PHP modes

<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) { ?> <h3>strpos() must have returned non-false</h3> <p>You are using Internet Explorer</p> <?php } else { ?> <h3>strpos() must have returned false</h3> <p>You are not using Internet Explorer</p> <?php } ?>
( sample output of this script may "e:

<h3>strpos() must have returned non-false</h3> <p>You are using Internet Explorer</p>
.nstead of usin! a PHP echo statement to output somethin!' we ,umped out of PHP mode and ,ust sent strai!ht H#$%& #he important and powerful point to note here is that the lo!ical flow of the script remains intact& Only one of the H#$% "loc*s will end up !ettin! sent to the viewer dependin! on the result of strpos()& .n other words' it depends on whether the strin! M)2E was found or not&

5ealin& with ,orms


One of the most powerful features of PHP is the way it handles H#$% forms& #he "asic concept that is important to understand is that any form element will automatically "e availa"le to your PHP scripts& Please read the manual section on >aria"les from outside of PHP for more information and examples on usin! forms with PHP& Here is an example H#$% form: E ample $!6. " simple HT4+ form

<form action="action.php" method="post"> <p>Your name: <input type="text" name="name" /></p> <p>Your age: <input type="text" name="age" /></p> <p><input type="submit" /></p> </form>
#here is nothin! special a"out this form& .t is a strai!ht H#$% form with no special ta!s of any *ind& When the user fills in this form and hits the su"mit "utton' the action.php pa!e is called& .n this file you would write somethin! li*e this: E ample $!7. Printin& data from our form

Hi <?php echo $_POST['name']; ?>. You are <?php echo $_POST['age']; ?> years old.
( sample output of this script may "e:

Hi Joe. You are 22 years old.


.t should "e o"vious what this does& #here is nothin! more to it& #he (_-O)T+, a3e,0 and (_-O)T+,a4e,0 varia"les are automatically set for you "y PHP& ;arlier we used the (_)ER*ER auto!lo"alM a"ove we ,ust introduced the GHPO # auto!lo"al which contains all PO # data& )otice how the 3ethod of our form is PO #& .f we used the method /ET then our form information would live in the GH3;# auto!lo"al instead& /ou may also use the GH2;=7; # auto!lo"al' if you do not care a"out the source of your reDuest data& .t contains the mer!ed information of 3;#' PO # and +OO6.; data& (lso see the import8re9uest81ariables() function& /ou can also deal with 89orms input in PHP' althou!h you will find yourself comforta"le with the well supported H#$% forms for Duite some time& While wor*in! with 89orms is not for "e!inners' you mi!ht "e interested in them& We also have a short introduction to handlin! data received from 89orms in our features section&

/sin& old code with new 1ersions of PHP


)ow that PHP has !rown to "e a popular scriptin! lan!ua!e' there are a lot of pu"lic repositories and li"raries containin! code you can reuse& #he PHP developers have lar!ely tried to preserve "ac*wards compati"ility' so a script written for an older version will run (ideally) without chan!es in a newer version of PHP& .n practice' some chan!es will usually "e needed& #wo of the most important recent chan!es that affect old code are:

#he deprecation of the old (HTT-_1_*.R) arrays (which need to "e indicated as !lo"al when used inside a function or method)& #he followin! auto!lo"al arrays were introduced in PHP :&I&J& #hey are: (_/ET' (_-O)T' (_COO52E' (_)ER*ER' (_627E)' (_EN*' (_RE8UE)T' and (_)E))2ON& #he older (HTT-_1_*.R) arrays' such as (HTT-_-O)T_*.R)' still exist as they have since PHP B& (s of PHP <&J&J' the lon! PHP predefined varia"le arrays may "e disa"led with the re!isterHlon!Harrays directive& ;xternal varia"les are no lon!er re!istered in the !lo"al scope "y default& .n other words' as of PHP :&?&J the PHP directive re!isterH!lo"als is o99 "y default in php.ini& #he preferred method of accessin! these values is via the auto!lo"al arrays mentioned a"ove& Older scripts' "oo*s' and tutorials may rely on this directive "ein! on& .f it were on' for example' one could use ('d from the 72% http://:::.e"a3ple.co3/9oo.php%'d;<2& Whether on or off' (_/ET+,'d,0 is availa"le&

9or more details on these chan!es' see the section on predefined varia"les and lin*s therein&

What:s ne t?
With your new *nowled!e you should "e a"le to understand most of the manual and also the various example scripts availa"le in the example archives& /ou can also find other examples on the php&net we"sites in the lin*s section: Elin*s&php& #o view various slide presentations that show more of what PHP can do' see the PHP +onference $aterial ites: http:EEconf&php&netE and http:EEtal*s&php&netE

II. Installation and Confi&uration


Table of Contents B& 3eneral .nstallation +onsiderations :& .nstallation on 7nix systems <& .nstallation on $ac O 8 N& .nstallation on Windows systems @& .nstallation of P;+% extensions A& Pro"lems? O& 2untime +onfi!uration

Chapter 0. -eneral Installation Considerations


4efore startin! the installation' first you need to *now what do you want to use PHP for& #here are three main fields you can use PHP' as descri"ed in the What can PHP do? section:

We"sites and we" applications (server-side scriptin!) +ommand line scriptin! 1es*top (37.) applications

9or the first and most common form' you need three thin!s: PHP itself' a we" server and a we" "rowser& /ou pro"a"ly already have a we" "rowser' and dependin! on your operatin! system setup' you may also have a we" server (e&!& (pache on %inux and $acO 8M .. on Windows)& /ou may also rent we"space at a company& #his way' you don0t need to set up anythin! on your own' only write your PHP scripts' upload it to the server you rent' and see the results in your "rowser& .n case of settin! up the server and PHP on your own' you have two choices for the method of connectin! PHP to the server& 9or many servers PHP has a direct module interface (also called (P.)& #hese servers include (pache' $icrosoft .nternet .nformation erver' )etscape and iPlanet servers& $any other servers have support for . (P.' the $icrosoft module interface (OmniH##Pd for example)& .f PHP has no module support for your we" server' you can always use it as a +3. or 9ast+3. processor& #his means you set up your server to use the +3. executa"le of PHP to process all PHP file reDuests on the server& .f you are also interested to use PHP for command line scriptin! (e&!& write scripts auto!eneratin! some ima!es for you offline' or processin! text files dependin! on some ar!uments you pass to them)' you always need the command line executa"le& 9or more information' read the section a"out writin! command line PHP applications& .n this case' you need no server and no "rowser& With PHP you can also write des*top 37. applications usin! the PHP-3#6 extension& #his is a completely different approach than writin! we" pa!es' as you do not output any H#$%' "ut mana!e windows and o",ects within them& 9or more information a"out PHP-3#6' please visit the site dedicated to this extension& PHP-3#6 is not included in the official PHP distri"ution& 9rom now on' this section deals with settin! up PHP for we" servers on 7nix and Windows with server module interfaces and +3. executa"les& /ou will also find information on the command line executa"le in the followin! sections& PHP source code and "inary distri"utions for Windows can "e found at Edownloads&php& We recommend you to choose a mirror nearest to you for downloadin! the distri"utions&

Chapter 2. Installation on /ni


Table of Contents (pache I&B&x on 7nix systems (pache ?&J on 7nix systems +audium fhttpd related notes un' iPlanet and )etscape servers on +3. and commandline setups HP-78 specific installation notes Open4 1 installation notes olaris specific installation tips 1e"ian 3)7E%inux installation notes

s#stems

un

olaris

#his section will !uide you throu!h the !eneral confi!uration and installation of PHP on 7nix systems& 4e sure to investi!ate any sections specific to your platform or we" server "efore you "e!in the process& (s our manual outlines in the 3eneral .nstallation +onsiderations section' we are mainly dealin! with we" centric setups of PHP in this section' althou!h we will cover settin! up PHP for command line usa!e as well& #here are several ways to install PHP for the 7nix platform' either with a compile and confi!ure process' or throu!h various pre-pac*a!ed methods& #his documentation is mainly focused around the process of compilin! and confi!urin! PHP& $any 7nix li*e systems have some sort of pac*a!e installation system& #his can assist in settin! up a standard confi!uration' "ut if you need to have a different set of features (such as a secure server' or a different data"ase driver)' you may need to "uild PHP andEor your we"server& .f you are unfamiliar with "uildin! and compilin! your own software' it is worth chec*in! to see whether some"ody has already "uilt a pac*a!ed version of PHP with the features you need& PrereDuisite *nowled!e and software for compilin!:

4asic 7nix s*ills ("ein! a"le to operate "ma*e" and a + compiler) (n () . + compiler flex: >ersion ?&<&: "ison: >ersion I&?A (preferred)' I&B<' or I&@< ( we" server (ny module specific components (such as !d' pdf li"s' etc&)

#he initial PHP setup and confi!uration process is controlled "y the use of the commandline options of the confi&ure script& /ou could !et a list of all availa"le options alon! with short explanations runnin! ./confi&ure !!help& Our manual documents the different options separately& /ou will find the core options in the appendix' while the different extension specific options are desci"ed on the reference pa!es& When PHP is confi!ured' you are ready to "uild the module andEor executa"les& #he command ma;e should ta*e care of this& .f it fails and you can0t fi!ure out why' see the Pro"lems section&

"pache 1.0.

on /ni

s#stems

#his section contains notes and hints specific to (pache installs of PHP on 7nix platforms& We also have instructions and notes for (pache ? on a separate pa!e& /ou can select ar!uments to add to the confi&ure on line IJ "elow from the list of core confi!ure options and from extension specific options descri"ed at the respective places in the manual& #he version num"ers have "een omitted here' to ensure the instructions are not incorrect& /ou will need to replace the 0xxx0 here with the correct values from your files& E ample 2!1. Installation Instructions ("pache .hared 4odule <ersion) for PHP

1. 2. 3. 4.

gunzip apache_xxx.tar.gz tar -xvf apache_xxx.tar gunzip php-xxx.tar.gz tar -xvf php-xxx.tar

5. 6. 7. 8. 9.

cd apache_xxx ./configure --prefix=/www --enable-module=so make make install cd ../php-xxx

10. Now, configure your PHP. This is where you customize your PHP with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 1 and MySQL support. Your path to apxs may differ from our example. ./configure --with-mysql --with-apxs=/www/bin/apxs 11. make 12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more. 13. Setup your php.ini file: cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer your php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves. 14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module libexec/libphp4.so For PHP 5: LoadModule php5_module libexec/libphp5.so 15. And in the AddModule section of httpd.conf, somewhere under the

ClearModuleList, add this: For PHP 4: AddModule mod_php4.c For PHP 5: AddModule mod_php5.c 16. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps 17. Use your normal procedure for starting the Apache server. (You must stop and restart the server, not just cause the server to reload by using a HUP or USR1 signal.)
(lternatively' to install PHP as a static o",ect: E ample 2!$. Installation Instructions (.tatic 4odule Installation for "pache) for PHP

1. 2. 3. 4. 5. 6. 7. 8. 9.

gunzip -c apache_1.3.x.tar.gz | tar xf cd apache_1.3.x ./configure cd .. gunzip -c php-5.x.y.tar.gz | tar xf cd php-5.x.y ./configure --with-mysql --with-apache=../apache_1.3.x make make install

10. cd ../apache_1.3.x 11. ./configure --prefix=/www --activate-module=src/modules/php5/libphp5.a (The above line is correct! Yes, we know libphp5.a does not exist at this stage. It isn't supposed to. It will be created.) 12. make (you should now have an httpd binary which you can copy to your Apache bin dir if

it is your first install then you need to "make install" as well) 13. cd ../php-5.x.y 14. cp php.ini-dist /usr/local/lib/php.ini 15. You can edit /usr/local/lib/php.ini file to set PHP options. Edit your httpd.conf or srm.conf file and add: AddType application/x-httpd-php .php
*ote: 2eplace php=> "y php=< and php> "y php< in PHP :& 1ependin! on your (pache install and 7nix variant' there are many possi"le ways to stop and restart the server& 4elow are some typical lines used in restartin! the server' for different apacheEunix installations& /ou should replace /path/to/ with the path to these applications on your systems& E ample 2!0. E ample commands for restartin& "pache

1. Several Linux and SysV variants: /etc/rc.d/init.d/httpd restart 2. Using apachectl scripts: /path/to/apachectl stop /path/to/apachectl start 3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl: /path/to/httpsdctl stop /path/to/httpsdctl start 4. Using mod_ssl, or another SSL server, you may want to manually stop and start: /path/to/apachectl stop /path/to/apachectl startssl
#he locations of the apachectl and http(s)dctl "inaries often vary& .f your system has locate or :here's or :h'ch commands' these can assist you in findin! your server control pro!rams& 1ifferent examples of compilin! PHP for apache are as follows:

./configure --with-apxs --with-pgsql


#his will create a libphp5.so (or libphp4.so in PHP :) shared li"rary that is loaded into (pache usin! a %oad$odule line in (pache0s httpd.conf file& #he Post!re =% support is em"edded into this li"rary&

./configure --with-apxs --with-pgsql=shared


#his will create a libphp4.so shared li"rary for (pache' "ut it will also create a pgsql.so shared li"rary that is loaded into PHP either "y usin! the extension directive in php.ini file or "y loadin! it explicitly in a script usin! the dl() function&

./configure --with-apache=/path/to/apache_source --with-pgsql

#his will create a libmodphp5.a li"rary' a mod_php5.c and some accompanyin! files and copy this into the src/3od#les/php> directory in the (pache source tree& #hen you compile (pache usin! ==act'?ate= 3od#le;src/3od#les/php>/l'!php>.a and the (pache "uild system will create libphp5.a and lin* it statically into the httpd "inary (replace php> "y php< in PHP :)& #he Post!re =% support is included directly into this httpd "inary' so the final result here is a sin!le httpd "inary that includes all of (pache and all of PHP&

./configure --with-apache=/path/to/apache_source --with-pgsql=shared


ame as "efore' except instead of includin! Post!re =% support directly into the final httpd you will !et a pgsql.so shared li"rary that you can load into PHP from either the php.ini file or directly usin! dl()& When choosin! to "uild PHP in different ways' you should consider the advanta!es and draw"ac*s of each method& 4uildin! as a shared o",ect will mean that you can compile apache separately' and don0t have to recompile everythin! as you add to' or chan!e' PHP& 4uildin! PHP into apache (static method) means that PHP will load and run faster& 9or more information' see the (pache we"pa!e on 1 O support& *ote: (pache0s default httpd.conf currently ships with a section that loo*s li*e this:

User nobody Group "#-1"


7nless you chan!e that to "3roup no!roup" or somethin! li*e that ("3roup daemon" is also very common) PHP will not "e a"le to open files& *ote: $a*e sure you specify the installed version of apxs when usin! ==:'th= ap"s;/path/to/ap"s& /ou must )O# use the apxs version that is in the apache sources "ut the one that is actually installed on your system&

Installation on /ni s#stems flconseil at #ahoo dot fr J@-$ar-?JJN JN:I<

add a note 7ser +ontri"uted )otes

Building Apache 2 and PHP 5.1.2 : On AIX 5.2 : http://flaupretre.free.fr/redir.php?key=build_apa_aix On HP-UX 11i (11.11) : http://flaupretre.free.fr/redir.php? key=build_apa_hpux These documents are complete step-by-step howtos, and describe how to buid a self-sufficient package, including every software it depends on (zlib, SSL, LDAP, iconv, expat, xml, xslt, gd, png, Xpm, jpeg, freetype, bzip2, curl, MySQL, PostgreSQL, Oracle, AdoDB).
dpresle#2 at #ahoo dot com JN-)ov-?JJ< JB::?

Hi, PROBLEM: ./configure PHP --with-oci8

fails with unresolved references such as __rpc_thread_destroy@GLIBC_2_2_3_... ONE SOLUTOIN FOR SOLVING PHP ./configure RESULTING IN __rcp_thread_destroy@GLIBC_2_2_3_... AND UNRESOLVED REFERENCES WITH ORACLE OCI8 KEYWORDS: PHP OCI OCI8 NET8 ./configure __rpc_thred_destroy UNRESOLVED

REFERENCES For building php-4.4.1 or later with oci8, make sure your LD_LIBARRY_PATH has at a minimum the following directories in its path for Oracle8i 8.1.5 or later, Oracle9i 9.0.2 or later, and Oracle9i Release 2: 9.2.0.4 or later, do the following: Note: We are not using the Oracle Instant Client here. have an actual Oracle Installation. 1. Set ORACLE_HOME Example using Oracle 9i Relase 2 -- 9.2.0.5: ORACLE_HOME=/opt/app/oracle/product/9iR2 2. Set LD_LIBRARY_PATH with: LD_LIBRARY_PATH=$ORACLE_HOME/lib: \ $ORACLE_HOME/rdbms/lib:\ $LD_LIBRARY_PATH 3. On Unix / Linux, don't forget to export these environment variables: export ORACLE_HOME LD_LIBRARY_PATH 4. Now, build PHP with the following: ./configure --with-apxs2=<path to Apache 2.0/bin/apxs> --withoci8=$ORACLE_HOME --enable-sigchild It should now build correctly. The key with Oracle is to ensure that you pick up the libclntX.so (client librariess) where X is the Oracle version associated with the version your using for instance, in the above example, libclnt9.so Also note that if your using Oracle 9iAS Release 2 v9.0.2, Oracle 10g iAS Release 1 v9.0.4.1, the above steps will work because ORACLE_HOME will containe all of the libraries necessary. Simply point ORACLE_HOME to the top level directory of these installations and set LD_LIBRARY_PATH as described above. Hope this helps.
phptard at &mail dot com ?B-$ar-?JJ< J::I@

This assumes you

after a long night of wrestling with mysql4.0 under linux compiled with the intel compiler, i've gotten php5.0.3 to compile with mysql libraries for this flavor of mysql: 1: download the mysql for linux/intel compiler and install 2: download the rpm for the intel compiler libraries and install 3: configure php with LDFLAGS="-lirc -lgcc_s" and EXTRA_LIBS="-lirc -lgcc_s" Example: LDFLAGS="-lirc -lgcc_s" LD_LIBRARY_PATH="-L/usr/lib64" LD_PATH="L/usr/lib64" LDPATH="-L/usr/lib64" EXTRA_LIBS="-lirc -lgcc_s" ./configure --with-apxs2=/usr/local/apache/bin/apxs --with-ssl=/usr/local/ssl --withoutsqlite --with-zlib-dir=/usr --with-mysql=/usr/local/mysql of course this is on a xeon system that has half of its modules in the /usr/lib64 directory, so on a normal system, without the other kruft, it would look something more like this: LDFLAGS="-lirc -lgcc_s" EXTRA_LIBS="-lirc -lgcc_s" ./configure --withapxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql Hopefully this will save someone the 6 hour headache it caused me..

diemu=i at &mail dot com IB--an-?JJ< IJ:II

In reference to van [at] webfreshener [dot] com to fix the krb5 problems. An easier fix is to do the following: ln -s /usr/kerberos/include/krb5.h /usr/include/krb5.h ln -s /usr/kerberos/include/profile.h /usr/include/profile.h ln -s /usr/kerberos/include/com_err.h /usr/include/com_err.h This will help solve some deps. in the future incase a situation with another compilation occurs.
ale ander >ustadot henr# at acm dot or& ??-1ec-?JJ: I?::A

The system at my workplace has a need for apache/php with all static compilation. In order to save time adminning our systems, I decided to make my own RPM of php/apache with mod_ssl support. I had always installed by hand with the instructions on this page, but when buiding the RPM way, came upon the following error when apache was compiling: ===> src/modules/php4 make[4]: *** No rule to make target `all'. Stop. Ordinarily this is because one did not do a 'make install' in php before the second apache configure, or somehow the make install failed. But the way rpm's work, the make install must be in the %install portion of the spec file, after all makes are completed. make install-sapi This line will copy relevant files to the directory specified in --withapache
samael?? at web dot de ?:--un-?JJ: JN:<I

Quick hint for people using RH8: if make gives you this error FT_ENCODING_MS_SYMBOL undeclared change on line in this file /usr/include/freetype2/freetype/freetype.h Search for ft_encoding_symbol - change it to ft_encoding_ms_symbol Now this problem is dealt with, go ahead with make. Good Luck !
robert8s&i at #ahoo dot com JA-$ay-?JJ: II:<@

If you install php 4 on SGI IRIX 6.5 (in my case it was php 4.3.6 on Silicon Graphics O2 IRIX 6.5.22 machine) and you're building it with: --with-gettext=/usr/freeware then you need to manually edit the file named "configure" (from the php source directory) and change the line# 36739 from: GETTEXT_LIBDIR=$GETTEXT_DIR/lib to: GETTEXT_LIBDIR=$GETTEXT_DIR/lib32 If you have problems in locating the line, search the text for "bindtextdomain", and look several (4) lines above.
;arthi; (dot) ; (at) e tremi IA--an-?JJ: JA:?A (dot) net

This is regarding the post down below about the problem with openssl on RH9. Openssl on RH9 is built with kerberos. To get PHP to build correctly you need the output of these commands when you make.

[root@graf-spee local]# pkg-config --cflags openssl -I/usr/kerberos/include [root@graf-spee local]# pkg-config --libs openssl -L/usr/kerberos/lib -lssl -lcrypto -lresolv -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -ldl -lz These could be added to your make command thus. I have not tested it out, but should work with some tweaking make EXTRA_LDFLAGS=`pkg-config --libs openssl` EXTRA_CFLAGS=`pkg-config --cflags openssl`
thansen at terra dot com dot br BJ-1ec-?JJB JA:BN

The configure directives --with-apxs2 and --with-apxs2filter are not compatible one with other, even though the configure script will not complain about that. Each one affect the way Apache will call the php parser: If you choose the first one, you must use the traditional include: AddType application/x-httpd-php php at httpd.conf, to call the parser. If you use the --with-apxs2filter, the include will be: <Files *.php> SetOutputFilter PHP SetInputFilter PHP </Files> , and php will be called as a filter to .php files. If you use both together, you will get compilation errors (duplicate symbols while linking libphp4).
aaronmorris at mindsprin& dot com J<-1ec-?JJB I?::@

If you have the libphp4.a instead of libphp4.so on AIX, you can extract the .so file from the .a file by running "ar -x libphp4.a".
>a=ee8at8bi&foot.com ?N-$ar-?JJB I?:<?

http://dan.drydog.com/apache2php.html has a nice set of instructions for Apache2 + php


dou& at *'.P"4 dot techie dot net J:-9e"-?JJB J<:IN

Users compiling under some versions of Solaris/SunOS may encounter the following error. symbol ap_block_alarms: referenced symbol not found To address this problem, add the following additional flag to the Apache build configure line: --enable-rule=SHARED_CORE So, adding this to the original instructions, you'd configure your Apache build like so: ./configure --prefix=/www --enable-module=so --enable-rule=SHARED_CORE Doug
mbabcoc;!php at fibrespeed dot net ?J--ul-?JJI JO:B?

The best configuration guide I've found for Apache with PHP (and PERL, mod_ssl, etc.) is Apacompile. Its home site is http://www.delouw.ch/linux/apache.phtml
dimaberastau at hotmail dot com JO--un-?JJI JO:BB

when installing with mysql support (--with-mysql=<path/to/your/mysql>) via Apache APXS you'll probably get something like 'can't load

libmysqlclient.so' when you try to start up apache. There are 2 solutions to this problem. First, (as documented in INSTALL file of the php4 distribution) you can modify /etc/ld.so.conf to contain the directory name where libmysqlclient.so is (so if your mysql is installed in /usr/local, you want to add something like /usr/local/lib/mysql into /etc/ld.so.conf), else (and particularly if you haven't got the super-user on the system) you can modify (or create if it isn't defined already) LD_LIBRARY_PATH shell variable to reflect the changes you would have otherwise made to /etc/ld.so.conf (again if mysql is /usr/local LD_LIBRARY_PATH=/usr/local/lib/mysql). Either one of these methods will get the problem sorted. Just remember to run ldconfig (so that /etc/ld.so.cache is updated) if you chose to modify /etc/ld.so.conf
marshalm at ebrd dot com I@-$ay-?JJI IJ::B

HP-UX 11.X PA-RISC installation with oracle (oci8). You need to install the HP-UX patch PHSS_22514 patch (updated libdld.sl), otherwise you will get errors with dlopen() and dlclose() not found during the apache integration stage.

"pache $.@ on /ni

s#stems

#his section contains notes and hints specific to (pache ?&J installs of PHP on 7nix systems& Warnin& We do not recommend usin! a threaded $P$ in production with (pache?& 7se the prefor* $P$ instead' or use (pacheI& 9or information on why' read the related 9(= entry on usin! (pache? with a threaded $P$ /ou are hi!hly encoura!ed to ta*e a loo* at the (pache 1ocumentation to !et a "asic understandin! of the (pache ?&J erver& PHP and "pache $.@. compatibilit# notes: #he followin! versions of PHP are *nown to wor* with the most recent version of (pache ?&J&x:

PHP :&B&J or later availa"le at Edownloads&php&

the latest sta"le development version& 3et the source code http:EEsnaps&php&netEphp<latest&tar&!C or download "inaries for Windows http:EEsnaps&php&netEwinB?Ephp<-winB?-latest&Cip& a prerelease version downloada"le from http:EEDa&php&netE& you have always the option to o"tain PHP throu!h anonymous +> &

#hese versions of PHP are compati"le to (pache ?&J&:J and later& (pache ?&J ).-2-support started with PHP :&?&J& PHP :&?&B wor*s with (pache ?&J&BO' don0t use any other version of (pache with PHP :&?&B& However' the recommended setup is to use PHP :&B&J or later with the most recent version of (pache?& (ll mentioned versions of PHP will wor* still with (pache I&B&x& 1ownload the most recent version of (pache ?&J and a fittin! PHP version from the a"ove mentioned places& #his Duic* !uide covers only the "asics to !et started with (pache ?&J and PHP& 9or more information read the (pache 1ocumentation& #he version num"ers have "een omitted here' to ensure the instructions are not incorrect& /ou will need to replace the 0))0 here with the correct values from your files& E ample 2!2. Installation Instructions ("pache $ .hared 4odule <ersion)

1. 2. 3. 4. 5. 6. 7. 8.

gzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tar gunzip php-NN.tar.gz tar -xvf php-NN.tar cd httpd-2_0_NN ./configure --enable-so make make install Now you have Apache 2.0.NN available under /usr/local/apache2, configured with loadable module support and the standard MPM prefork. To test the installation use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start and stop the server to go on with the configuration for PHP: /usr/local/apache2/bin/apachectl stop.

9.

cd ../php-NN This is where you customize your PHP

10. Now, configure your PHP.

with various options, like which extensions will be enabled. Do a ./configure --help for a list of available options. In our example we'll do a simple configure with Apache 2 and MySQL support. Your path to apxs may differ, in fact, the binary may even be named apxs2 on your system. ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql 11. make 12. make install If you decide to change your configure options after installation, you only need to repeat the last three steps. You only need to restart apache for the new module to take effect. A recompile of Apache is not needed. Note that unless told otherwise, 'make install' will also install PEAR, various PHP tools such as phpize, install the PHP CLI, and more. 13. Setup your php.ini cp php.ini-dist /usr/local/lib/php.ini You may edit your .ini file to set PHP options. If you prefer having php.ini in another location, use --with-config-file-path=/some/path in step 10. If you instead choose php.ini-recommended, be certain to read the list of changes within, as they affect how PHP behaves. 14. Edit your httpd.conf to load the PHP module. The path on the right hand side of the LoadModule statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be sure to check. For PHP 4: LoadModule php4_module modules/libphp4.so For PHP 5: LoadModule php5_module modules/libphp5.so 15. Tell Apache to parse certain extensions as PHP. For example, let's have Apache parse the .php extension as PHP. You could have any extension(s) parse as PHP by simply adding more, with each separated by a space. We'll add .phtml to demonstrate. AddType application/x-httpd-php .php .phtml

It's also common to setup the .phps extension to show highlighted PHP source, this can be done with: AddType application/x-httpd-php-source .phps 16. Use your normal procedure for starting the Apache server, e.g.: /usr/local/apache2/bin/apachectl start
9ollowin! the steps a"ove you will have a runnin! (pache ?&J with support for PHP as ).-2 module& Of course there are many more confi!uration options availa"le for "oth' (pache and PHP& 9or more information use ./confi&ure !!help in the correspondin! source tree& .n case you wish to "uild a multithreaded version of (pache ?&J you must overwrite the standard $P$-$odule prefork either with worker or perchild& #o do so append to your confi!ure line in step N a"ove either the option ==:'th= 3p3;:or@er or ==:'th=3p3;perch'ld& #a*e care a"out the conseDuences and understand what you are doin!& 9or more information read the (pache documentation a"out the $P$-$odules& *ote: .f you want to use content ne!otiation' read the (pache $ulti>iews 9(=& *ote: #o "uild a multithreaded version of (pache your system must support threads& #his also implies to "uild PHP with experimental Pend #hread afety (P# )& #herefore not all extensions mi!ht "e availa"le& #he recommended setup is to "uild (pache with the standard prefork $P$-$odule&

"pache $.@ on /ni >a#a J<--ul-?JJN II::I

add a note 7ser +ontri"uted )otes

s#stems

PHP 5.1.4 INSTALLATION on Solaris 9 (Sparc) Solaris9 Packages Installed: Verify required package installation: root# pkginfo SUNWbtool SUNWsprot SUNWtoo SUNWhea SUNWarc \ SUNWlibm SUNWlibms SUNWdfbh SUNWxglh SUNWcg6h Uninstall Default Apache Packages: root# /etc/init.d/apache stop root# pkginfo |grep Apache root# pkgrm SUNWaclg SUNWapchd SUNWapchr SUNWapchu Create installation Directory: root# mkdir /phpdata/ Download Required Packages from Sunfreeware: Install libiconv-1.8 and gcc3.3.2 packages root# pkgadd -d ./libiconv-1.8-sol9-sparc-local root# pkgadd -d ./gcc-3.3.2-sol9-sparc-local set LD_LIBRARY_PATH, CC and PATH variables root# LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/sparcv9/:\ /usr/lib:/usr/openwin/lib:/opt/local/lib:/usr/local/ssl/lib:\ /usr/local/apr/lib:/opt/mysql/mysql/lib root# CC=gcc root# PATH=$PATH:/usr/ucb:/usr/local/bin/ root# export LD_LIBRARY_PATH CC PATH Install apr-1.2.2 and aprutil-1.2.2 packages root# gzcat apr-1.2.2.tar.gz |tar xvf root# cd apr-1.2.2

root# root# root# root# root# root# root# root# root#

./configure make make install cd .. gzcat aprutil-1.2.2.tar.gz |tar xvf cd apr-util-1.2.2/ ./configure --with-apr=/usr/local/apr/ make make install

Install gawk-3.1.4, expat-1.95.5, db-4.2.52.NC, gdbm-1.8.3, libgcc-3.3 and libxml2-2.6.16 packages root# cd .. root# pkgadd -d ./gawk-3.1.4-sol9-sparc-local root# pkgadd -d ./expat-1.95.5-sol9-sparc-local root# pkgadd -d ./db-4.2.52.NC-sol9-sparc-local root# pkgadd -d ./gdbm-1.8.3-sol9-sparc-local root# pkgadd -d ./libgcc-3.3-sol9-sparc-local root# pkgadd -d ./libxml2-2.6.16-sol9-sparc-local Install GNU make package root# gzcat make-3.81.tar.gz |tar xvf root# cd make-3.81 root# ./configure root# make root# make install root# cd .. Install mysql-standard-5.0.22 package Search for user mysql root# grep mysql /etc/passwd root# grep mysql /etc/group If not found create user and group mysql root# groupadd mysql root# useradd -G mysql mysql root# pkgadd -d ./mysql-standard-5.0.22-solaris9-sparc.pkg.gz Install openssl-0.9.7g package root# gzcat openssl-0.9.7g.tar.gz |tar xvf root# cd openssl-0.9.7g root# ./config shared root# make root# make install root# cd .. Install Apache2 package root# gzcat httpd-2.2.0.tar.gz |tar xvf root# cd httpd-2.2.0 root# ./configure --enable-so root# /usr/local/bin/make root# /usr/local/bin/make install root# cd .. Install php-5.1.4 package root# gzcat php-5.1.4.tar.gz |tar xvf root# cd php-5.1.4 root# ./configure --with-apxs2=/usr/local/apache2/bin/apxs\ --with-ldap --with-mysql=/opt/mysql/mysql/ root# /usr/local/bin/make root# /usr/local/bin/make install root# cp php.ini-dist /usr/local/lib/php.ini Edit httpd.conf to load the PHP module and to parse certain extensions as PHP root# vi /usr/local/apache2/conf/httpd.conf LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml

Start Apache root# /usr/local/apache2/bin/apachectl start Add environmental variables below HTTPD root# vi /usr/local/apache2/bin/apachectl LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/sparcv9/: /usr/lib:/usr/openwin/lib:/opt/local/lib:/usr/local/ssl/lib: /usr/local/apr/lib:/opt/mysql/mysql/lib PATH=/bin:/sbin:/usr/ccs/bin:/usr/sbin:/usr/openwin/bin:\ /usr/ucb:/usr/local/bin/ export LD_LIBRARY_PATH PATH Create Apache Startup Script
pillepop$@@0 at #ahoo dot de IO-(pr-?JJN JO:IA

For unix (especially opensuse 10.0) you can find bison and flex here: ftp.gnu.org/non-gnu/flex ftp.gnu.org/pub/gnu/bison Peace ;-)
feli cca at #ahoo dot ca ?O-$ar-?JJN JN:IB

I've (painfully) discovered that installing PHP5 with "make install" under SuSe 9.2 is NOT a good idea. http://www.aditus.nu/jpgraph/apache2suse.php This page explains how to install it without breaking everything that's phprelated in the Apache2 configuration. Its first purpose, though, is to show how to have php 4 and 5 to cohabit properly.
pa#ne727 at #ahoo dot com I:-9e"-?JJN JA:J<

When compiling php 5.1.2 on Debian 3.1 (Sarge) with Apache 2.2.0, I ran into problems with libxml2 and libxml2-config not found errors. After checking the base install, Debian leaves out the libxml2 headers, they can be downloaded using apt-get: apt-get install libxml2 libxml2-dev PHP should then compile fine.
fran;Aethisoft ?A- ep-?JJ< J?:BJ

Using Apache2 & PHP5 work perfectly fine & safe together. - all core modules are safe in Zend Engine 2 - third-party-libraries should be avoided - semaphores and shared memory enables you to ensure yourself that your application/website is thread-safe also with non-thread-safe PHP modules!
happ#bo# at php dot or& JB-(u!-?JJ< J::BJ

FILE TRUNCATED!! during the make process should u receive an error declaring ext/ctype/ctype.lo (or another file) is truncated then you need to 'make clean' prior to a healthy 'make' and 'make install.' looking into your ext/ directory you may find the offensive file to be 1 byte long.
18santhanam at nospam dot ettimadai dot amrita dot edu I?-$ay-?JJ< II:BJ

if you are getting the following error : "Cannot load /usr/local/apache2/modules/libphp4.so into server: /usr/local/apache2/ modules/libphp4.so: undefined symbol: compress" , you have to add --withzlib to php config
su;hruprai at #ahoo dot com BJ-$ar-?JJ< JB:I@

For good step by step instructions read Compiling PHP and Apache 2 from source on Linux OS: http://www10.brinkster.com/ssruprai/comphp.asp
f&&arcia at ice dot co dot cr ?<-$ar-?JJ< J<:?N

I think that it's important says that the option --withapxs2=/usr/local/apache2/bin/apxs in the configure script it's necesary to build the libphp5.so (in PHP5). Then in the make install command, this .so module will be installed in the modules directory of Apache home I see on the Web a lot of persons with the trouble of missing the libphp5.so and this is the solution. Regards, Frank.
mihai dot sandu at &tstelecom dot ro ?A-9e"-?JJ< J<:??

For the SuSE9.2 install of PHP5. First: If building on a x64 platform, please set LDFLAGS="-L/usr/lib64" before configure. As for install, it suffices to go to /etc/apache2 and: ln -s sysconfig.d/loadmodule.conf httpd2-prefork.conf and then make install
neil IJ-9e"-?JJ< J?:?I

To install mysql and mysqli with PHP5 do the following: after doing: ./configure --with-mysql=/path/to/mysql_config --withmysqli=/path/to/mysql_config do this: " if you want to use both the old mysql and the new mysqli interface, load the Makefile into your editor and search for the line beginning with EXTRA_LIBS; it includes -lmysqlclient twice; remove the second instance " then you can: make make install ..... Pleasse note: you must have mysql-dev installed (RPM or source) or you will not have the mysql_config file at all. The standard, server, and client installations of MySQL do not include it. I read somewhere that the mysql and mysqli paths must be identical. Quoted from Michael Kofler at the following link: http://www.kofler.cc/forum/forumthread.php?rootID=3571
>martin*' at .P"4columbiaser1ices dot net ?:--an-?JJ< JB:::

Well I was getting the following error when trying to run make (shared module for Apache 2.0.52) *** Warning: inter-library dependencies are not known to be supported. *** All declared inter-library dependencies are being dropped. (Then of course 'make install' would puke on itself not having what it needs.)

Soo, after some time looking I found that using: libtoolize --force and following the instructions to add the contents of 1 file to the local file cat /some/dir/file1 >> localfile Would produce the desired results when you run: make clean make
5an .cott (dan dot scott at acm dot or&) IO--an-?JJ< JA:BN

Building PHP 5.x with Apache2 on SuSE Professional 9.1/9.2 SuSE uses a rather fragmented set of Apache configuration files stored in /etc/apache2/. When you configure PHP 5.x with: $ ./configure --with-apxs2=/usr/sbin/apxs2 $ make everything builds just fine; but when you issue: $ su -c "make install" the unconventional Apache conf file layout confuses the install-sapi section of the Makefile and the process halts with the following error: apxs:Error: Config file /etc/apache2/httpd2-prefork.conf not found. make: *** [install-sapi] Error 1 At this point only the PHP SAPI library has been copied into place; the rest of the files (like PEAR scripts, PHP-CLI, etc) have not been installed. But never fear! You can overcome this problem with the following steps: 1. Edit Makefile and change the following line to remove "install-sapi": install_targets = install-sapi install-cli install-pear install-build install-headers install-programs 2. Issue the make install command again: $ su -c "make install" 3. Add the PHP module & type instructions to the Apache configuration. As root, create a new file, /etc/apache2/conf.d/php5.conf that contains the following lines: LoadModule php5_module /usr/lib/apache2/libphp5.so AddType application/x-httpd-php php --- And that's it. Everything else is just as the documentation suggests it should be.
Bon 5ru;man IB--an-?JJ< J::JO

We have been running Apache 2 Prefork + PHP 4 (many different versions) for well over a year now, serving 10's of millions of pages per day on dozens of servers. It is completely stable and reliable.
pra1een dot ; at masconit dot com I<-)ov-?JJ: JI:BA

Hi too had same problem with multiview like when i execute http://huey/admin/test.php it used to compile but when i use http://huey/admin/test it wouldnt recognise it as php file... i worked it out with the addhandler method and AddType in different line and setting multiview for directive "multiviews Options Indexes FollowSymLinks MultiViews"

the directives u can set it to root directory so now when u type pn test it will search in precendence for test.php, test.html if any ..... its working for me with apache2.0.47 and php 4.3.9 on solaris praveen
nospam!1 at spam dot matt dot blissett dot me dot u; BJ- ep-?JJ: JB:<?

If you're trying to get PHP and Multiviews to work properly, try this page: http://tranchant.plus.com/notes/multiviews (In brief, a request for the URL http://example.net/thing, where there are possible matches thing.php and thing.pdf, returns a 406 with many browsers because of the application/x-httpd-php MIME type set above. The link above gives a better method for using php, instead using these directives: AddHandler php5-script php [or php-script for php4] AddType text/html php For more info see the link.)

Caudium
PHP : can "e "uilt as a Pi*e module for the +audium we"server& )ote that this is not supported with PHP B& 9ollow the simple instructions "elow to install PHP : for +audium& E ample 2!3. Caudium Installation Instructions

1.

Make sure you have Caudium installed prior to attempting to install PHP 4. For PHP 4 to work correctly, you will need Pike 7.0.268 or newer. For the sake of this example we assume that Caudium is installed in /opt/caudium/server/. 2. Change directory to php-x.y.z (where x.y.z is the version number). 3. ./configure --with-caudium=/opt/caudium/server 4. make 5. make install 6. Restart Caudium if it's currently running. 7. Log into the graphical configuration interface and go to the virtual server where you want to add PHP 4 support. 8. Click Add Module and locate and then add the PHP 4 Script Support module. 9. If the documentation says that the 'PHP 4 interpreter isn't available', make sure that you restarted the server. If you did check /opt/caudium/logs/debug/default.1 for any errors related to <filename>PHP4.so</filename>. Also make sure that <filename>caudium/server/lib/[pike-version]/PHP4.so</filename> is present. 10. Configure the PHP Script Support module if needed.
/ou can of course compile your +audium module with support for the various extensions availa"le in PHP :& ee the reference pa!es for extension specific confi!ure options& *ote: When compilin! PHP : with $y =% support you must ma*e sure that the normal $y =% client code is used& Otherwise there mi!ht "e conflicts if your Pi*e already has $y =% support& /ou do this "y specifyin! a $y =% install directory the ==:'th=3AsBl option&

fhttpd related notes


#o "uild PHP as an fhttpd module' answer "yes" to "4uild as an fhttpd module?" (the --with-fhttpdQD2R option to confi!ure) and specify the fhttpd source "ase directory& #he default directory is /usr/local/src/fhttpd& .f you are runnin! fhttpd' "uildin! PHP as a module will !ive "etter performance' more control and remote execution capa"ility& *ote: upport for fhttpd is no lon!er availa"le as of PHP :&B&J&

.unC iPlanet and *etscape ser1ers on .un .olaris


#his section contains notes and hints specific to un -ava ystem We" iPlanet and )etscape server installs of PHP on un olaris& erver' un O); We" erver'

9rom PHP :&B&B on you can use PHP scripts with the ) (P. module to !enerate custom directory listin!s and error pa!es& (dditional functions for (pache compati"ility are also availa"le& 9or support in current we"servers read the note a"out su"reDuests& /ou can find more information a"out settin! up PHP for the )etscape ;nterprise http:EE"enoit&noss&free&frEphpEinstall-php:&html erver (); ) here:

#o "uild PHP with un - W E un O); W EiPlanetE)etscape we"servers' enter the proper install directory for the --with-nsapiQR1.2S option& #he default directory is usually /opt/netscape/suitespot/& Please also read /php-xxx-version/sapi/nsapi/nsapi-readme.txt&

I&

.nstall the followin! pac*a!es from http:EEwww&sunfreeware&comE or another download site:

autoconf-2.13 automake-1.4 bison-1_25-sol26-sparc-local flex-2_5_4a-sol26-sparc-local gcc-2_95_2-sol26-sparc-local gzip-1.2.4-sol26-sparc-local m4-1_4-sol26-sparc-local make-3_76_1-sol26-sparc-local mysql-3.23.24-beta (if you want mysDl support) perl-5_005_03-sol26-sparc-local tar-1.13 (3)7 tar)

?&

$a*e sure your path includes the proper directories -.TH;.:/#sr/local/!' :/#sr/s!' :/#sr/!' :/#sr/ccs/!' and ma*e it availa"le to your system export PATH&

B& gunzip php-x.x.x.tar.gz (if you have a &!C dist' otherwise !o to :)& :& tar xvf php-x.x.x.tar <& +han!e to your extracted PHP directory: cd ../php-x.x.x N& 9or the followin! step' ma*e sure /opt/netscape/suitespot/ is where your netscape server
is installed& Otherwise' chan!e to the correct path and run:

./configure --with-mysql=/usr/local/mysql \ --with-nsapi=/opt/netscape/suitespot/ \ --enable-libgcc

@&

2un ma;e followed "y ma;e install&

(fter performin! the "ase install and readin! the appropriate readme file' you may need to perform some additional confi!uration steps& Confi&uration Instructions for .un/iPlanet/*etscape. 9irstly you may need to add some paths to the 7D_72CR.RD_-.TH environment for the server to find all the shared li"s& #his can "est done in the start script for your we"server& #he start script is often located in: /path/to/server/httpsservername/start& /ou may also need to edit the confi!uration files that are located in: /path/to/server/https-servername/config/&

I& ?&

(dd the followin! line to mime.types (you can do that "y the administration server):

type=magnus-internal/x-httpd-php exts=php
;dit magnus.conf (for servers TQ N) or obj.conf (for servers U N) and add the followin!' shli" will vary dependin! on your system' it will "e somethin! li*e

/opt/netscape/suitespot/bin/libphp4.so& /ou should place the followin! lines after


3'3e tApes ' 't&

Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="/opt/netscape/suitespot/bin/libphp4.so" Init fn="php4_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"]

B& :&

(PHP TQ :&B&B) #he php_' ' parameter is optional "ut with it you can place your php.ini in your we"server confi! directory& +onfi!ure the default o",ect in obj.conf (for virtual server classes Rversion N&JVS in their vserver.obj.conf):

<Object name="default"> . . . .#NOTE this next line should happen after all 'ObjectType' and before all 'AddLog' lines Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inikey=value ...] . . </Object>

<&

N&

(PHP TQ :&B&B) (s additional parameters you can add some special php.ini-values' for example you can set a docroot;E/path/to/docrootE specific to the context php<_e"ec#te is called& 9or "oolean ini-*eys please use JEI as value' not EO EFEO99EF... (this will not wor* correctly)' e&!& Gl'!.o#tp#t_co3press'o ;1 instead of Gl'!.o#tp#t_co3press'o ;EO E #his is only needed if you want to confi!ure a directory that only consists of PHP scripts (same li*e a cgi-bin directory):

<Object name="x-httpd-php"> ObjectType fn="force-type" type="magnus-internal/x-httpd-php" Service fn=php4_execute [inikey=value inikey=value ...] </Object>

@&
A&

(fter that you can confi!ure a directory in the (dministration server and assi!n it the style "= httpd=php& (ll files in it will !et executed as PHP& #his is nice to hide PHP usa!e "y renamin! files to .html& etup of authentication: PHP authentication cannot "e used with any other authentication& (%% (7#H;)#.+(#.O) . P( ;1 #O /O72 PHP +2.P#& #o confi!ure PHP (uthentication for the entire server' add the followin! line to your default o",ect:

<Object name="default"> AuthTrans fn=php4_auth_trans . . . </Object>


O& #o use PHP (uthentication on a sin!le directory' add the followin!:

<Object ppath="d:\path\to\authenticated\dir\*"> AuthTrans fn=php4_auth_trans </Object>


*ote: #he stac*siCe that PHP uses depends on the confi!uration of the we"server& .f you !et crashes with very lar!e PHP scripts' it is recommended to raise it with the (dmin erver (in the section "$(3)7 ;1.#O2")&

C-I en1ironment and recommended modifications in php.ini


.mportant when writin! PHP scripts is the fact that un - W E un O); W EiPlanetE)etscape is a multithreaded we" server& 4ecause of that all reDuests are runnin! in the same process space (the space of the we"server itself) and this space has only one environment& .f you want to !et +3. varia"les li*e -.TH_2N6O' HTT-_HO)T etc& it is not the correct way to try this in the old PHP B&x way with &eten1() or a similar way (re!ister !lo"als to environment' (_EN*)& /ou would only !et the environment of the runnin! we"server without any valid +3. varia"lesF *ote: Why are there (invalid) +3. varia"les in the environment? (nswer: #his is "ecause you started the we"server process from the admin server which runs the startup script of the we"server' you wanted to start' as a +3. script (a +3. script inside of the admin serverF)& #his is why the environment of the started we"server has some +3. environment varia"les in it& /ou can test this "y startin! the we"server not from the administration server& 7se the command line as root user and start it manually you will see there are no +3.-li*e environment varia"les& imply chan!e your scripts to !et +3. varia"les in the correct way for PHP :&x "y usin! the super!lo"al (_)ER*ER& .f you have older scripts which use (HTT-_HO)T' etc&' you should turn on re4'ster_4lo!als in php.ini and chan!e the varia"le order too (important: remove EEE from it' "ecause you do not need the environment here):

variables_order = "GPCS" register_globals = On

.pecial use for error pa&es or self!made director# listin&s (PHP DE 2.0.0)
/ou can use PHP to !enerate the error pa!es for E<0< Not 6o# dE or similar& (dd the followin! line to the o",ect in obj.conf for every error pa!e you want to overwrite:

Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...]


where HHH is the H##P error code& Please delete any other Error directives which could interfere with yours& .f you want to place a pa!e for all errors that could exist' leave the code parameter out& /our script can !et the H##P status code with (_)ER*ER+,ERROR_TD-E,0& (nother possi"ility is to !enerate self-made directory listin!s& -ust create a PHP script which displays a directory listin! and replace the correspondin! default ervice line for tApe;E3a4 #s=' ter al/d'rectorAE in obj.conf with the followin!:

Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...]


9or "oth error and directory listin! pa!es the ori!inal 72. and translated 72. are in the varia"les (_)ER*ER+,-.TH_2N6O,0 and (_)ER*ER+,-.TH_TR.N)7.TED,0&

*ote about nsapi81irtual() and subre9uests (PHP DE 2.0.0)

#he ) (P. module now supports the nsapi81irtual() function (alias: 1irtual()) to ma*e su"reDuests on the we"server and insert the result in the we"pa!e& #his function uses some undocumented features from the ) (P. li"rary& On 7nix the module automatically loo*s for the needed functions and uses them if availa"le& .f not' nsapi81irtual() is disa"led& *ote: 4ut "e warned: upport for nsapi81irtual() is ;8P;2.$;)#(%FFF

.unC iPlanet and *etscape ser1ers on .un .olaris ericbac;strom at hotmail dot com ?@-$ar-?JJN JB:JO

add a note 7ser +ontri"uted )otes

Using gcc 3.3 I had problems compiling PHP for 64 bits, I had to replace mysql/64 bits with mysql/32 bits (Solaris cannot mix 32 bits and 64 bits libraries), so I specified the following compiler flag: CFLAGS="-m32";export CFLAGS; I also had problems with PHP 5.1.2 in sapi/nsapi/nsapi.c source code, It had incorrect comments and file paths :S When trying to install PHP with mysql support I found I had these problems too: http://bugs.php.net/bug.php?id=34516... So don't mix sun ld and gcc ld because you will get into troubles. I built mysql libraries myself in a separated directory. And don't forget to set your LD_LIBRARY_PATH to something like: LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"
1i>a# IB-$ar-?JJN JN::A

If I start my iPlanet (v6.0 SP2) webserver with PHP5.1.2 i get this message every 1/2 sec in my error log.... [12/Mar/2006:11:01:48] failure (15936): Failed to read kernel statistics structures (No such device or address) This happens only if I start my server loading PHP module. FYI - When I configured my php I had it use oracle instant client libraries. One fix I found was to comment out this line in my magnus.conf file. #Init fn="stats-init" profiling="on" But I don't think i can do this on my prodcution machine. Any ideas to come around this issue? Thanks Vijay
>edo;ahn at #ahoo dot com at ?B-)ov-?JJ: I?:<J

I noted and installed *all* pkgs required to compile PHP5 but kept getting an error on compile when it attempted to test the gcc compiler. The /usr/ccs/bin and all the $PATH requirements were ALL there....why the error? I tried running gcc from the command prompt and got a "gcc: fatal: libiconv.so.2: open failed: "....DUH I needed to install the libiconv pkg from sunfreeware.com for gcc compiler to work. Just a small bonehead maneuver, but I thought I would add it just in case someone else ran into the particular problem.
masochisthalo at #ahoo dot com ?B-(u!-?JJ: J?:?A

Title: Barebones PHP Installation on Sun One Web Server 6.1 for JDS2 Author: Hijinio Reynoso Jr. Last Updated: August 23, 2004 Summary: If you have installed Sun One Web Server 6.1 on the JDS (aka Java

Desktop System from Sun), this will help you get PHP installed on it (without XML and MySQL support.) In any case, this should get you started which is better than not having it installed at all. These directions were based mainly on those available from PHP.net, but updated to meet the needs of this specific configuration. Instructions ---------------------------0. Make sure your web server isn't running and ensure that all JDS developer packages are installed; to be safe, I always ensure that all developer packages are available via Applications > System Tools > Administration > Software Installer 1. Download http://us3.php.net/get/php-5.0.1.tar.bz2/from/a/mirror and extract into the directory of your choice. (5.0.1 was the only version I could get to make install correctly) 2. CD into the extracted PHP directory and type: > ./configure --with-nsapi=/opt/SUNWwbsvr --enable-libgcc --disable-libxml (Your web server directory may vary from the above's default.) 3. Once it's done configuring (and it should be successful should you have all the proper packages), type: > make 4. When its done compiling, it's time to install as root: # make install 5. Now, configuration of your web server begins: # cd /opt/SUNWwbsvr/https-[yourWebServer]/config 6. vi mime.types (or other editor) to add this line into it: type=magnus-internal/x-httpd-php exts=php 7. vi magnus.conf to add the following 2 lines to end of it: (NOTE: the 2nd line could be optional) Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" shlib="/opt/SUNWwbsvr/bin/libphp5.so" Init fn="php5_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_ini="/path/to/php.ini"] 8. vi obj.conf to add the following line to <Object name="default">. Make sure this happens after all "ObjectType" entries and before any "AddLog" entries: (NOTE: for virtual servers, edit vserver.obj.conf) Service fn="php5_execute" type="magnus-internal/x-httpd-php" [inikey=value inikey=value ...] 9. Now, start up your web server. Also, make sure to log into the admin server and click the "Apply" button in there. You will also have set "index.php" as an index filename in your virtual server's Document Preferences. 10. Congrats! Now, you have PHP installed! Of course, there are other features you could enable (MySQL, XML, etc.), but I haven't tested against those. Just consult the following page for hints: http://www.php.net/manual/en/install.unix.sun.php
mar; at mar;round dot com IO-(u!-?JJ: JO:BN

Quick note : By replacing "php4" with "php5", the above instructions work perfectly when building PHP5 for an iPlanet server. EG:Init fn="load-modules" funcs="php5_init,php5_execute,php5_auth_trans" etc. Works fine here on 6.0SP2, Solaris 9 Sparc. -Mark [mark at markround dot com]

C-I and commandline setups


#he default is to "uild PHP as a +3. pro!ram& #his creates a commandline interpreter' which can "e used for +3. processin!' or for non-we"-related PHP scriptin!& .f you are runnin! a we" server PHP has module support for' you should !enerally !o for that solution for performance reasons& However' the +3. version ena"les users to run different PHP-ena"led pa!es under different user-ids& Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s& (s of PHP :&B&J' some important additions have happened to PHP& ( new (P. named +%. also exists and it has the same name as the +3. "inary& What is installed at I-RE62HJ/!' /php depends on your confi!ure line and this is descri"ed in detail in the manual section named 7sin! PHP from the command line& 9or further details please read that section of the manual&

Testin&
.f you have "uilt PHP as a +3. pro!ram' you may test your "uild "y typin! ma;e test& .t is always a !ood idea to test your "uild& #his way you may catch a pro"lem with PHP on your platform early instead of havin! to stru!!le with it later&

Fenchmar;in&
.f you have "uilt PHP B as a +3. pro!ram' you may "enchmar* your "uild "y typin! ma;e bench& )ote that if safe mode is on "y default' the "enchmar* may not "e a"le to finish if it ta*es lon!er then the BJ seconds allowed& #his is "ecause the set8time8limit() can not "e used in safe mode& 7se the maxHexecutionHtime confi!uration settin! to control this time for your own scripts& ma;e bench i!nores the confi!uration file& *ote: ma;e bench is only availa"le for PHP B&

/sin& <ariables
ome server supplied environment varia"les are not defined in the current +3.EI&I specification& Only the followin! varia"les are defined there: .UTH_TD-E' CONTENT_7EN/TH' CONTENT_TD-E' /.TEW.D_2NTER6.CE' -.TH_2N6O' -.TH_TR.N)7.TED' 8UERD_)TR2N/' REMOTE_.DDR' REMOTE_HO)T' REMOTE_2DENT' REMOTE_U)ER' RE8UE)T_METHOD' )CR2-T_N.ME' )ER*ER_N.ME' )ER*ER_-ORT' )ER*ER_-ROTOCO7' and )ER*ER_)O6TW.RE& ;verythin! else should "e treated as 0vendor extensions0&

C-I and commandline setups info at ch$o dot info I@--un-?JJ< J@:<O

add a note 7ser +ontri"uted )otes

additionnal information to fastcgi... the compilation of fastcgi library is not nessesary, php include a modified version of this library, and fastcgi module have this own implementation of the protocole fastcgi... on the first server (where apache are!) the uid and gid of apache instance of the fastcgi module must be the same on the php file to execute... without that they dont work... the module refuse to send the request to the fastcgi php server...
info at ch$o dot info IB--un-?JJ< IJ:<O

for using fastcgi external server in place of cgi or mod php with php: to compile fastcgi librairie:

wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz tar xzvf fcgi-2.4.0.tar.gz cd fcgi-2.4.0 ./configure make gmake install to compile the fastcgi apache module: wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.2.tar.gz tar xvzf mod_fastcgi-2.4.2.tar.gz cd mod_fastcgi-2.4.2 path/to/apache/bin/apxs -i -A -n fastcgi -o mod_fastcgi.la -c *.c after you must modify the http.conf to add that: # load fcgi module LoadModule fastcgi_module # authorization to execute fcgi <Location /fcgi-bin/> Options ExecCGI SetHandler fastcgi-script </Location> modules/mod_fastcgi.so on tree "/fcgi-bin/"

# define fastcgi external serveur for virtual path "/fcgi-bin/phpfcgi" to execute on targetmachinehost with targetport FastCgiExternalServer /fcgi-bin/phpfcgi -host targetmachinehostname:targetport # mime type definietion for some extention AddType application/x-httpd-fastphp .php .cphp .php4 #define apache cgi regirection with the virtual action script /fcgibin/phpfcgi associated with the defined mime type. Action application/x-httpd-fastphp /fcgi-bin/phpfcgi start apache. compile php with --enable-cgi and --enable-fastcgi=/to/lib/fastcgi

start on target machine php with "php -b ip:port" for ear request from mod_fastcgi. some aditional thing are in sapi/cgi/README.FastCGI of php src tree. the document root of the apache machine must be synchronous with the php target machine... with the same tree... and with that solution you can mixe php5 and php4 with different extention of apache directory limitation to one or another version... with performance like mod_php!
;ptrs at #ahoo dot com JN--un-?JJ: J::B@

Dug out from the discussion at the site below is a good tip: if you are working with an existing PHP installation which did not build either the commandline or CGI servers, you can use the lynx non-graphical web browser to get the web server to execute php scripts from the command line (or cron jobs, etc): lynx -dump http://whatever >If you wish to use PHP as a scripting language, a good article to read is >http://www.phpbuilder.com/columns/darrell20000319.php3

>note that the article is aimed at *nix not win32, but most of it still applies
phil at phil;ern dot de JB--an-?JJB IJ::J

Thanks nordkyn, this one was very helpful. Please note that the kernel has to be compiled with misc binary support, which is activated on most distributions like Debian. You would have to please these two lines in a script to run it after every reboot, on debian I propose /etc/init.d/bootmisc.sh You could place this lines at the end but before : exit 0 --# Install PHP as binary handler mount -t binfmt_misc none /proc/sys/fs/binfmt_misc echo ":PHP:E::php::/usr/bin/php4:" > /proc/sys/fs/binfmt_misc/register --And please remember that the package management would override the file on the next distribution upgrade :)
c1 at corbach dot de ?J-9e"-?JJ? JA:IA

Up to and including 4.1.1 you have to set doc_root to an non empty value if you configure PHP for CGI usage with --enable-discard-path.

HP!/G specific installation notes


#his section contains notes and hints specific to installin! PHP on HP-78 systems& (+ontri"uted "y paulHmc*ay at clearwater-it dot co dot u*)& *ote: #hese tips were written for PHP :&J&: and (pache I&B&O&

I& ?& B& :& <&

/ou need !Cip' download a "inary distri"ution from

http://hpux.connect.org.uk/ftp/hpux/Gnu/gzip-1.2.4a/gzip-1.2.4a-sd10.20.depot.Z uncompress the file and install usin! swinstall&


/ou need !cc' download a "inary distri"ution from

http://gatekeep.cs.utah.edu/ftp/hpux/Gnu/gcc-2.95.2/gcc-2.95.2-sd10.20.depot.gz& uncompress this file and install !cc usin! swinstall&


/ou need the 3)7 "inutils' you can download a "inary distri"ution from

http://hpux.connect.org.uk/ftp/hpux/Gnu/binutils-2.9.1/binutils-2.9.1sd-10.20.depot.gz& uncompress this file and install "inutils usin! swinstall&


/ou now need "ison' you can download a "inary distri"ution from

http://hpux.connect.org.uk/ftp/hpux/Gnu/bison-1.28/bison-1.28-sd10.20.depot.gz' install as a"ove&


/ou now need flex' you need to download the source from one of the http:EEwww&!nu&or! mirrors& .t is in the non-!nu directory of the ftp site& 1ownload the file' &un=ip' then tar ! 1f it& 3o into the newly created flex directory and run ./confi&ure' followed "y ma;e' and then ma;e install& .f you have errors here' it0s pro"a"ly "ecause !cc etc& are not in your P(#H so add them to your P(#H& N& 1ownload the PHP and apache sources& &un=ip and tar ! 1f them& We need to hac* a couple of files so that they can compile O6& 9irstly the confi!ure file needs to "e hac*ed "ecause it seems to lose trac* of the fact that you are a hpux machine' there will "e a "etter way of doin! this "ut a cheap and cheerful hac* is to put lt_tar4et;hp#"10.20 on line :@?AN of the confi!ure script&

@& A& O&

)ext' the (pache 3uessO file needs to "e hac*ed& 7nder apache_1.3.9/src/helpers chan!e line AO from echo Ehp(IH-UHM.CHJ=hp#"(IH-UH*ERJEK e"'t 0 to: echo Ehp( IH-UHM.CHJ=hp=hp#"(IH-UH*ERJEK e"'t 0 IJ& /ou cannot install PHP as a shared o",ect under HP-78 so you must compile it as a static' ,ust follow the instructions at the (pache pa!e&

II&

PHP and (pache should have compiled O6' "ut (pache won0t start& you need to create a new user for (pache' e&!& www' or apache& /ou then chan!e lines ?<? and ?<B of the conf/httpd.conf in (pache so that instead of

User nobody Group nogroup


I?& you have somethin! li*e

User www Group sys


IB& #his is "ecause you can0t run (pache as no"ody under hp-ux& (pache and PHP should then wor*&

HP!/G specific installation notes <ina#a; ?B-$ar-?JJN J::I:

add a note 7ser +ontri"uted )otes

Installing PHP 5.x with Apache 2.x on HP UX 11i and configuring PHP 5.x with Oracle 9i

I am very glad to share this information to configure PHP 5.x work with Apache 2.x and Oracle 9i on HP UX 11i. Step 1: Install Apache 2.x with DSO support: -------------------------------------------This is a stratight forward Apache installation with --enable-so option gzip -d httpd-2_0_NN.tar.gz tar xvf httpd-2_0_NN.tar cd httpd-2_0_NN ./configure \ --prefix=/var/apps/apache2 \ --enable-so \ --enable-mods-shared=most \ --libexecdir=/var/apps/apache2/libexec You can add other options as required. make make install Step 2: Install and configure PHP 5.x with Oracle 9i ---------------------------------------------------Edit the ./configure file to change "$OCI8_DIR/lib" as "$OCI8_DIR/lib32" By default, with Oracle 9i, "$OCI8_DIR/lib" will be poiting to Oracle 64 bit libraries in "$OCI8_DIR/lib64" directory. Unfortunately, PHP 5.x does not work with 64 bit oracle shared libraries. Run configure.. $ ./configure \ --prefix=/var/apps/php \ --with-apxs2=/var/apps/apache2/bin/apxs \ --with-oci8=/oracle/app/product/9.0.2 \ --disable-libxml \ --enable-libgcc \ --enable-ftp \ --enable-calendar \ --enable-track-vars \ --enable-trans-sid \ --enable-sigchild \ --libexecdir=/var/apps/apache2/libexec \ --with-config-file-path=/var/apps/apache2/conf --enable-libgcc \ --enable-sigchild \ You can add other options as required. You can use the --help option to configure to get a complete list. After configure runs, you must edit the file libtool. $ vi ./libtool At line 184, you should change the line from: deplibs_check_method="unknown" to deplibs_check_method="pass_all" so that PHP and mod_php are properly compiled. 3. Compile and install the files.

Run make. This should complete normally. $ make Run make install. This will fail when it attempts to call apxs. $ make install Step 3: Configure Apache 2.x ---------------------------Edit httpd.conf file to include For PHP 5: LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php .php .phtml

Set environment variables in $APACHE_ROOT/bin/envvars file SHLIB_PATH="/var/apps/apache2/lib:$SHLIB_PATH" export SHLIB_PATH LD_LIBRARY_PATH=$ORACLE_HOME/app/product/9.0.2 /lib32 export LD_LIBRARY_PATH LD_PRELOAD=/usr/lib/libpthread.sl:$ORACLE_HOME/app/ product/9.0.2/JRE/lib/PA_RISC/native_threads/libjava.sl export LD_PRELOAD After lot of hard work, by following the above procedure, we were able to make PHP 5.x is work with Apache 2.x and Oracle 9i on HP UX 11i OS. Hope this will save your time!!
flconseil at #ahoo dot fr ?B--an-?JJN JN::@

If hpws is not an option for you, or if you want to build Apache and PHP with your own options and extensions, I have written a step by step tutorial. It explains how to build Apache 2.0 and PHP 5 from scratch on HP-UX 11i (11.11), including most modules and extensions (zlib, SSL, LDAP, iconv, expat, xml, xslt, gd, png, Xpm, jpeg, freetype, bzip2, curl, MySQL, PostgreSQL, Oracle, AdoDB) : http://flaupretre.free.fr/redir.php?key=build_apa_php
4arcus dot Heimann at reimann!s#stemberatun& dot de ?O-(u!-?JJB J@:<J

If you need an Apache2-Server with PHP4 under HP-UX 11.x, it's a good way to download the HP-WebServer from the HP-Website (http://software.hp.com). The HP-Webserver comes with numerous moduls. First install the HP-Webserver (swinstall -s /absolute_path_to_depot_file/name_of_depot_file). After that, download the newest PHP-Version from http://www.php.net (HP ships the HPWebserver with an old PHP-Version) and unpack the tar-file in a workingdirectory. Use the following parameters for configure PHP: ./configure --with-apxs2=/opt/hpws/apache/bin/apxs --prefix=/opt/hpws/apache/php [and so on...] If configure prints the error "expr: An integer value was expected.", than you have to edit the Script "configure". Replace the line: APACHE_VERSION=`expr $4 \* 1000000 + $5 \* 1000 + $6`

with the following (correct and very long) line: APACHE_VERSION=`$APXS_HTTPD -v | head -1 | cut -f3 -d' ' | cut -f2 -d'/' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` Why? The output of "httpd -v" prints the following string: Server version: HP-UX_Apache-based_Web_Server/2.0.46 Server built: Jun 26 2003 04:41:28 But the configure-Script can't deal with this string.
>ason dot sheets at hp dot com ?@-9e"-?JJB J?::<

In order to use PHP 4.3.0 on HP-UX 11 I've found I must compile it statically with Apache, it does not build as a module.
>sheets at shadotech dot com BJ- ep-?JJ? II::?

To clarify the my $dso_ext = "so"; comment, you can find my $dso_ext = "so"; in your apxs script you need to change that line to my $dso_ext = "sl"; otherwise make install will fail.
ni;rou at ifrance dot com JA-(u!-?JJ? J::B?

On HP-UX 11.00, there's a problem to compiling PHP as a DSO module. The script apxs is looking fot libphp4.so instead of libphp4.sl. Change the line in the script (search "extension"). Write : my $dso_ext = "sl"; instead of : my $dso_ext = "so"; // old line Nicolas
ichoudhur#@@7 at #ahoo dot com BJ-$ay-?JJ? JO:II

On HP-UX 11 ... When you are compiling PHP as DSO, you will encounter an error during "make install" /usr/local/apache/bin/apxs -i -a -n php4 libs/libphp4.sl apxs:Error: file libs/libphp4.sl is not a DSO *** Error exit code 1 ---- This is because installation is looking for libphp4.so instead of sl. You can rename or link as libphp4.so and run
>ames at nospam dot hp dot com ?A--an-?JJ? J@::N

To build for HP-UX 10.X/11.X (and some other UNIX variants) with '--enablesockets', you'll get an error about 'u_int' being redefined in /usr/include/netinet/in.h and ext/sockets/sockets.c will fail to compile. The problem is this line from main/php_config.h: #define in_addr_t u_int The above define is a problem because HP-UX (and some other UNIXs) typedef in_addr_t. A good workaround is to replace this define in main/php_config.h with the lines from the HP-UX 11.X netinet/in.h header file (which will work for 10.X as well): #ifndef _IN_ADDR_T #define _IN_ADDR_T #ifdef __LP64__ typedef unsigned int in_addr_t; #else typedef unsigned long in_addr_t; #endif #endif
spam at adhocinc dot com II-Oct-?JJI J?:B<

For PHP 4.0.6 under HP-UX 11.00, I ran into errors during the compilation related to "LC_CTYPE" and other "LC_" vars. The compilation complained that "LC_" such and such first used in such and such function. (I think the error first came up in php_pcre.c, then in basic_functions.c). The solution was to add "#include <locale.h>" to the php.h file. Compilation was

successful after that was added, with no other issues. apache 1.3.20, bison 1.28, flex 2.5.4.a.
ste1en at oa;leafconsultanc# dot com ?B--ul-?JJI JA:?A

Used gcc 2.95.3,

Just a quick point to those of you (like me!) who might not be sharp enough to notice this: If you want to install PHP on an HP-UX 11.x box then you'll need to download and install the 11.x (not 10.20) versions of the software (like gcc and bison). I didn't notice this and spent a large proportion of a day trying to figure out why the software wouldn't install! Steve
marshalm at ebrd dot com I@-$ay-?JJI IJ:<A

HP-UX 11.X PA-RISC installation with oracle (oci8). You need to install the HP-UX patch PHSS_22514 patch (updated libdld.sl), otherwise you will get errors with dlopen() and dlclose() not found during the apache integration stage.
>onas88linden at hotmail dot com ??--an-?JJI JO:J<

Building under HP-UX11 If you are using HP ANSI C you have to add +e i.e -Aa -D_HPUX_SOURCE +e

'penF.5 installation notes


#his section contains notes and hints specific to installin! PHP on Open4 1 B&N&

/sin& Finar# Pac;a&es


7sin! "inary pac*a!es to install PHP on Open4 1 is the recommended and simplest method& #he core pac*a!e has "een separated from the various modules' and each can "e installed and removed independently from the others& #he files you need can "e found on your Open4 1 +1 or on the 9#P site& #he main pac*a!e you need to install is php4-core-4.3.8.tgz' which contains the "asic en!ine (plus !ettext and iconv)& )ext' ta*e a loo* at the module pac*a!es' such as php4-mysql-4.3.8.tgz or php4-imap-4.3.8.tgz& /ou need to use the php s command to activate and deactivate these modules in your php.ini& E ample 2!6. 'penF.5 Pac;a&e Install E ample

# pkg_add php4-core-4.3.8.tgz # /usr/local/sbin/phpxs -s # cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini (add in mysql) # pkg_add php4-mysql-4.3.8.tgz # /usr/local/sbin/phpxs -a mysql (add in imap) # pkg_add php4-imap-4.3.8.tgz # /usr/local/sbin/phpxs -a imap (remove mysql as a test) # pkg_delete php4-mysql-4.3.8 # /usr/local/sbin/phpxs -r mysql (install the PEAR libraries) # pkg_add php4-pear-4.3.8.tgz
2ead the pac*a!es(@) manual pa!e for more information a"out "inary pac*a!es on Open4 1&

/sin& Ports
/ou can also compile up PHP from source usin! the ports tree& However' this is only recommended for users familiar with Open4 1& #he PHP : port is split into two su"-directories: core and extensions& #he extensions directory !enerates su"-pac*a!es for all of the supported PHP modules& .f you find you do not want to create some of these modules' use the no8I 9%(>O2& 9or example' to s*ip "uildin! the imap module' set the 9%(>O2 to no8imap&

Common Problems

#he default install of (pache runs inside a chroot(?) ,ail' which will restrict PHP scripts to accessin! files under /var/www& /ou will therefore need to create a /var/www/tmp directory for PHP session files to "e stored' or use an alternative session "ac*end& .n addition' data"ase soc*ets need to "e placed inside the ,ail or listen on the localhost interface& .f you use networ* functions' some files from /etc such as /etc/resolv.conf and

/etc/services will need to "e moved into /var/www/etc& #he Open4

1 P;(2 pac*a!e automatically installs into the correct chroot directories' so no special modification is needed there& $ore information on the Open4 1 (pache is availa"le in the Open4 1 9(=& #he Open4 1 B&N pac*a!e for the !d extension reDuires 89reeAN to "e installed& .f you do not wish to use some of the font features that reDuire 8II' install the php4-gd-4.3.8-no_x11.tgz pac*a!e instead&

'lder Heleases
Older releases of Open4 1 used the 9%(>O2 system to compile up a statically lin*ed PHP& ince it is hard to !enerate "inary pac*a!es usin! this method' it is now deprecated& /ou can still use the old sta"le

ports trees if you wish' "ut they are unsupported "y the Open4 1 team& .f you have any comments a"out this' the current maintainer for the port is (nil $adhavapeddy (avsm at open"sd dot or!)&

'penF.5 installation notes h& at ostc dot de I<-$ay-?JJ< IJ::<

add a note 7ser +ontri"uted )otes

Also you should add "-a /var/www/dev/log" to the syslogd_flags for propper logging of php-extensions like imap.so and create a /var/www/etc/master.passwd with an www-user-entry and run pwd_mkdb -d /var/www/etc /var/www/etc/master.passwd for propper use of libc-client.a functions in imap.so.
openbsd!fanatic IJ-$ay-?JJ< JI:<I

I am user that is just migrating to open source and thought I would take openbsd for a spin. This article, by Gregory L. Magnusson, really helped me to get a working apache-php-mysql server going on openbsd. http://www.devx.com/security/Article/28059/0/page/1
ameen(at)dausha(dot)net J?-)ov-?JJB J@::@

I just finished spinning my wheels with PHP/Apache on OpenBSD 3.3, and it took a Google to fix my problem. I followed the instructions by (0429196301 at netcabo dot pt) written on Sep 19, 2003 and kept being fed a segmentation fault when I tried to start httpd. Then I read the page cited below that suggested playing with the order of the LoadModules, and put the PHP first. I followed that recommendation and httpd started without problems! Page that saved me: http://archives.neohapsis.com/archives/openbsd/2002-04/3074.html "Change around the order of the Apache modules, this is one of the drawbacks to the module API for Apache 1.3 is that the order is very important. I would try making the PHP 4 module first, Perl module second and FP module last. "
sanchero JatK &1su JdotK edu JO-$ay-?JJB II:<O

On OpenBSD 3.2, given the steps outlined above using pre-built packages you will get a new "/var/www/conf/httpd.conf" that contains a section like this: <IfDefine SSL> AddModule mod_ssl.c AddModule mod_php4.c </IfDefine> This causes mod_php4 to load only when starting Apache w/SSL, so if this isn't what you want add the mod_php4 line again above (or below) this section, like so: AddModule mod_php4.c <IfDefine SSL> AddModule mod_ssl.c AddModule mod_php4.c </IfDefine> <<------ SEE? - now should load normally.

I also added this for good measure: <IfModule mod_php4.c> AddType application/x-httpd-php .php [blah blah] </IfModule> Seems to work.

.olaris specific installation tips


#his section contains notes and hints specific to installin! PHP on olaris systems&

He9uired software
olaris installs often lac* + compilers and their related tools& 2ead this 9(= for information on why usin! 3)7 versions for some of these tools is necessary& #he reDuired software is as follows:

!cc (recommended' other + compilers may wor*) ma*e flex "ison m: autoconf automa*e perl !Cip tar 3)7 sed

.n addition' you will need to install (and possi"ly compile) any additional software specific to your confi!uration' such as Oracle or $y =%&

/sin& Pac;a&es
/ou can simplify the olaris install process "y usin! p*!add to install most of your needed components&

.olaris specific installation tips o=one at cname dot com I<--an-?JJN JO::N

add a note 7ser +ontri"uted )otes

php >= 5.1.1 requires a fully GNU toolchain on solaris; /usr/ccs/bin/ld will fail to link. see bug 35496.
" + IO-1ec-?JJ< IJ::A

If you have problems building php with sqlite on solaris, add "-lrt" library so you dont get the fdatasync undefined symbol error.
anacreo I@-1ec-?JJ: JA:II

Below was copied from a Sun Forum -- if having problems compiling on Solaris 10 try this: Re: where is ctid_t defined? (Solaris 10) Author: Juergen.Keil Nov 17, 2004 10:37 AM (reply 1 of 10) ctid_t is defined in /usr/include/sys/types.h ("typedef id_t ctid_t;"). I guess what has happend is that you're using a gcc compiler that was build on Solaris 9 (or some other Solaris release older than Solaris 10 b69), and this gcc release has a set of "fixed" gcc specific headers that don't match your s10b69 system headers any more. The fix is to build a fresh set of gcc "fixed" headers: # cd /opt/sfw/gcc-3/lib/gcc-lib/i386-pc-solaris2.9/3.3.2/install-tools/ # cat > mkheaders.conf SHELL=/bin/sh SYSTEM_HEADER_DIR="/usr/include" OTHER_FIXINCLUDES_DIRS=""

FIXPROTO_DEFINES="-D_XOPEN_SOURCE" STMP_FIXPROTO="stmp-fixproto" STMP_FIXINC="stmp-fixinc" ^D # ./mkheaders


lar; at sdf dot lonestar dot or& II--ul-?JJB J@::A

If you do a "Core Install" of Solaris, be sure you have installed the SUNWlibm and SUNWlibms packages. PHP 4.2.3 fails to compile without them. If you get errors with GCC about math.h, then you don't have them installed.
e>flores at alcatel dot es JB--ul-?JJB JN:I:

./configure not run fine with /usr/ucb/tr you need to install GNU textutils
ine1es at iportalmais dot pt J@-$ar-?JJB JB:JO

I have compiled php 4.2.3, on my solaris 9, sparc, it works, i have gcc 3.2.2, from sunfreeware.org, i have compiled with ./configure --prefix=/opt/php --with-apxs=/opt/apache/bin/apxs --withpgsql=/opt/pgsql --with-imap=/usr/src/soft/imap-2002b --with-ldap --withimap-ssl=/usr/local/ssl It compiles, but when i try to run it says something like: bash-2.05# /opt/apache/bin/apachectl start Syntax error on line 205 of /opt/apache/conf/httpd.conf: Cannot load /opt/apache/libexec/libphp4.so into server: ld.so.1: /opt/apache/bin/httpd: fatal: relocation error: file /opt/apache/libexec/libphp4.so: symbol ldap_start_tls_s: referenced symbol not found /opt/apache/bin/apachectl start: httpd could not be started This means that the ldap librarys that came with solaris, are not very fine, you should use from openldap.org packages... it is using this library: bash-2.05# ldd /opt/apache/libexec/libphp4.so ... libldap.so.5 => /usr/lib/libldap.so.5 his one is from solaris installation. (sorry about my english)
nicos at php dot net JN--an-?JJB J@::O

Note that you also need GNU sed or you'll have some errors lile "Output line too long."
m at hac;er= dot u; dot co I<-Oct-?JJ? JO::O

Compiled Ok on Solaris 9 after the addition of Bison Flex automake and autoconf, adding /usr/local/bin to the path and linking /usr/ccs/bin/ar to /usr/local/bin/ar.
php at wood*'!.P"4stea dot com ?N--un-?JJ? II:I<

Howard Glynn's post from May 22 is right on - if you're running Solaris 8, make sure you get the latest Recommended patch cluster. I've been struggling with that library problem that happens when you start Apache for several weeks, tweaking the config, setting LD_LIBRARY_PATH, etc. I couldn't believe that the PHP developers wouldn't have the Solaris build right - seems like a fairly important OS. But the latest Solaris patch cluster fixed the problem, so I guess it was my fault for not being up to date. I'm running PHP 4.2.1 now with Apache 2.0.36, works great.

ltfrench at 1t dot edu JO--un-?JJ? J?:JO

To get PHP 4.2.0 or better to make on Solaris 8 (using gcc and gnu autoconf) you need to: ln -s /usr/local/bin/gcc /usr/local/bin/cc See: http://bugs.php.net/bug.php?id=16833
howard&l#nn at hotmail dot com ??-$ay-?JJ? IJ:?N

I've had a lot of problems with "dn_skipname" reference errors when trying to do a php / apache shared-library install on solaris 8. All compiling was clean, but could not restart apache with mod_php. After much trial and error, I found a solution by installing patch 109326-07 which has some fixes for resolver (I think). I had one web server without the patch, and one with it, and was able to show the same commands compiling, working and restarting on one, but not the other. Installed patch on machine, compiled clean and was up and running after doing this. Works great. Get the patch from sun.com
&smith1 at iupui dot edu JB-(pr-?JJ? J::B<

Loading 4.1.2 on solaris 8 in C shell with mysql 4.0.1 I kept running into file not found errors by ld during make. A specific error relating to adding mysql was solved by adding the following environment variable: setenv LD_RUN_PATH=/usr/lib:/usr/local/lib:/usr/local/mysql/lib
shane dot ;insch at netracorp dot com*'.P"4 I@-9e"-?JJ? I?::O

PHP 4.1.1 / Apache 1.32 Buile Issues (Solaris 2.8) Apache build options: ./configure --prefix=/usr/local/etc/apache --enable-module=rewrite --enableshared=rewrite PHP build options: ./configure --with-mysql=/usr/local/etc/mysql --withapxs=/usr/local/etc/apache/bin/apxs Both Apache and PHP compiled without errors and installed cleanly. The Error when starting Apache: Syntax error on line 208 of /usr/local/etc/apache/conf/httpd.conf: Cannot load /usr/local/etc/apache/libexec/libphp4.so into server: ld.so.1: /usr/local/etc/apache/bin/httpd: fatal: relocation error: file /usr/local/etc/apache/libexec/libphp4.so: symbol dn_skipname: referenced symbol not found ./apachectl start: httpd could not be started Line 208 in the httpd.conf file is: LoadModule php4_module libexec/libphp4.so The solution: For some reason, even though LD_LIBRARY_PATH was being set properly, it wasn't being read fully. You will need to create a runtime linking environment by doing this: #crle -c /var/ld/ld.config -l /usr/lib:/usr/local/lib:/usr/local/etc/mysql/lib Shane Kinsch NetraCorp LLC / SecurNET Consulting
>a;ob dot nielsen at nhst dot no JA--an-?JJ? J<:BO

You can get all the Solaris Packages needed for the PHP installation on http://www.sunfreeware.com/
+ouis at ewens dot com ??--un-?JJI J@:BO

On Solaris, if upon starting Apache you get an error like this:

Syntax error on line 33 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1: /usr/loca l/apache/bin/httpd: fatal: libmysqlclient.so.10: open failed: No such file or directory ./apachectl start: httpd could not be started ..try inserting the following lines into the configuration section of your apachectl startup shell script: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/mysql/lib/mysql export LD_LIBRARY_PATH Change the /usr/local/mysql/ prefix to where ever your MySQL installation is. Make sure to add on the /lib/mysql extension to your own path though. Do your normal "apachectl start" command to start Apache and voila, no more error. Apachectl can be found in the bin directory of your Apache installation.
cullin at comets#stems dot com ??--an-?JJI JA:<O

When compiling and installing on Solaris, you might encounter a but that occurs only when you try and start apache - in otherwords, the module compiles fine but it won't run! The specific error is that it can't find a symbol called "__muldi3". From what I can tell, this is an internal symbol created by gcc and the problem happens when you compile the code with gcc and then use a different linker. To fix the problem, make sure that there is only one 'ld' program in your $PATH and that you also specify '--with-gnu-ld' in your configuration.

5ebian -*//+inu

installation notes

#his section contains notes and hints specific to installin! PHP on 1e"ian 3)7E%inux&

/sin& "PT
While you can ,ust download the PHP source and compile it yourself' usin! 1e"ian0s pac*a!in! system is the simplest and cleanest method of installin! PHP& .f you are not familiar with "uildin! software on %inux' this is the way to !o& #he first decision you need to ma*e is whether you want to install (pache I&B&x or (pache ?&x& #he correspondin! PHP pac*a!es are respectively named li"apache-mod-php5 and li"apache?-mod-php5& #he steps !iven "elow will use (pache I&B&x& Please note that' as of this writin!' there is no official 1e"ian pac*a!es of PHP <& #hen the steps !iven "elow will install PHP :& PHP is availa"le in 1e"ian as +3. or +%. flavour too' named respectively php:-c!i and php:-cli& .f you need them' you0ll ,ust have to reproduce the followin! steps with the !ood pac*a!e names& (nother special pac*a!e you0d want to install is php:-pear& .t contains a minimal P;(2 installation and the pear commandline utility& .f you need more recent pac*a!es of PHP than the 1e"ian0s sta"le ones or if some PHP modules lac*s the 1e"ian official repository' perhaps you should ta*e a loo* at http:EEwww&apt-!et&or!E& One of the results found should "e 1otde"& #his unofficial repository is maintained "y 3uillaume Plessis and contains 1e"ian pac*a!es of the most recent versions of PHP : and PHP <& #o use it' ,ust add the to followin! two lines to your /etc/apt/sources.lists and run apt!&et update : E ample 2!7. The two 5otdeb related lines

deb http://packages.dotdeb.org stable all deb-src http://packages.dotdeb.org stable all


#he last thin! to consider is whether your list of pac*a!es is up to date& .f you have not updated it recently' you need to run apt!&et update "efore anythin! else& #his way' you will "e usin! the most recent sta"le version of the (pache and PHP pac*a!es& )ow that everythin! is in place' you can use the followin! example to install (pache and PHP: E ample 2!L. 5ebian Install E ample with "pache 1.0

# apt-get install libapache-mod-php4


(P# will automatically install the PHP : module for (pache I&B' and all its dependencies and then activate it& .f you0re not as*ed to restart (pache durin! the install process' you0ll have to do it manually : E ample 2!?. .toppin& and startin& "pache once PHP 2 is installed

# /etc/init.d/apache stop # /etc/init.d/apache start

Fetter control on confi&uration


.n the last section' PHP was installed with only core modules& #his may not "e what you want and you will soon discover that you need more activated modules' li*e $y =%' c72%' 31' etc& When you compile PHP from source yourself' you need to activate modules via the confi&ure command& With (P#' you ,ust have to install additional pac*a!es& #hey0re all named 0php:-50 (or 0php<-50 if you installed PHP < from a third party repository)&

E ample 2!1@. -ettin& the list of PHP additional pac;a&es

# dpkg -l 'php4-*'
(s you can see from the last output' there0s a lot of PHP modules that you can install (excludin! the php:c!i' php:-cli or php:-pear special pac*a!es)& %oo* at them closely and choose what you need& .f you choose a module and you do not have the proper li"raries' (P# will automatically install all the dependencies for you& .f you choose to add the $y =%' c72% and 31 support to PHP the command will loo* somethin! li*e this: E ample 2!11. Install PHP with 4#.M+C c/H+ and -5

# apt-get install php4-mysql php4-curl php4-gd


(P# will automatically add the appropriate lines to your different php.ini (/etc/php4/apache/php.ini' /etc/php4/cgi/php.ini' etc)& E ample 2!1$. These lines acti1ate 4#.M+C c/H+ and -5 into PHP

extension=mysql.so extension=curl.so extension=gd.so


/ou0ll only have to stopEstart (pache as previously to activate the modules&

Common Problems

.f you see the PHP source instead of the result the script should produce' (P# has pro"a"ly not included /etc/apache/conf.d/php4 in your (pache I&B confi!uration& Please ensure that the followin! line is present in your

/etc/apache/httpd.conf file then stopEstart (pache:

E ample 2!10. This line acti1ates PHP 2 into "pache

# Include /etc/apache/conf.d/

.f you installed an additional module and if its functions are not availa"le in your scripts' please ensure that the appropriate line is present in your php.ini' as seen "efore& (P# may fail durin! the installation of the additional module' due to a confusin! de"conf confi!uration&

5ebian -*//+inu installation notes Fen ". I@-1ec-?JJ< IJ:<B

add a note 7ser +ontri"uted )otes

Although there are no PHP 5 packages for Debian 3.1 (aka "stable" or "sarge"), there are currently PHP 5 packages for "testing"/"etch" and "unstable"/"sid". Installation works the same way. Also, the same process can be used for Ubuntu, but note that some of the packages may be in the "universe" section instead of "main".
>imm#chan at e ample dot com ?B-Oct-?JJ< IJ:JI

If you are using Debian 3.1 It is total, the php.ini is under /etc/php4/apache2

Since Debian 3.1 default apache is 2.0.x version, this one just said how to change the php.ini under apache 1.3.x If you need enable the ext. need manaul edit php.ini, and comment out # of what the ext. that you want to enable Of course, you much first install the ext. first by like that apt-get install php4-gd php4-mysql ......

Chapter 6. Installation on Windows s#stems


Table of Contents Windows .nstaller $anual .nstallation teps (ctive cript $icrosoft .. E PW (pache I&B&x on $icrosoft Windows (pache ?&J&x on $icrosoft Windows un' iPlanet and )etscape servers on $icrosoft Windows OmniH##Pd erver am"ar erver on $icrosoft Windows 8itami on $icrosoft Windows 4uildin! from source .nstallation of extensions on Windows #his section applies to Windows OAE$e and Windows )#E?JJJE8PE?JJB& PHP will not wor* on IN "it platforms such as Windows B&I and sometimes we refer to the supported Windows platforms as WinB?& Windows O< is no lon!er supported as of PHP :&B&J& #here are two main ways to install PHP for Windows: either manually or "y usin! the installer& .f you have $icrosoft >isual tudio' you can also "uild PHP from the ori!inal source code&

Once you have PHP installed on your Windows system' you may also want to load various extensions for added functionality& Warnin& #here are several all-in-one installers over the .nternet' "ut none of those are endorsed "y PHP&net' as we "elieve that the manual installation is the "est choice to have your system secure and optimised&

Windows Installer
#he Windows PHP installer is availa"le from the downloads pa!e at Edownloads&php& #his installs the C/2 ?ers'o of PHP and for .. ' PW ' and 8itami' it confi!ures the we" server as well& #he installer does not include any extra external PHP extensions (phpH5&dll) as you0ll only find those in the Windows Pip Pac*a!e and P;+% downloads& *ote: While the Windows installer is an easy way to ma*e PHP wor*' it is restricted in many aspects as' for example' the automatic setup of extensions is not supported& 7se of the installer isn0t the preferred method for installin! PHP& 9irst' install your selected H##P (we") server on your system' and ma*e sure that it wor*s& 2un the executa"le installer and follow the instructions provided "y the installation wiCard& #wo types of installation are supported - standard' which provides sensi"le defaults for all the settin!s it can' and advanced' which as*s Duestions as it !oes alon!& #he installation wiCard !athers enou!h information to set up the php.ini file' and confi!ure certain we" servers to use PHP& One of the we" servers the PHP installer does not confi!ure for is (pache' so you0ll need to confi!ure it manually& Once the installation has completed' the installer will inform you if you need to restart your system' restart the server' or ,ust start usin! PHP& Warnin& 4e aware' that this setup of PHP is not secure& .f you would li*e to have a secure PHP setup' you0d "etter !o on the manual way' and set every option carefully& #his automatically wor*in! setup !ives you an instantly wor*in! PHP installation' "ut it is not meant to "e used on online servers&

Installation on Windows s#stems

add a note 7ser +ontri"uted )otes

ma dot floden at t>it>in& dot com BJ-$ay-?JJN JB:J@

This is a great instruction for installing php 5 on a windows 2003/iis 6 server. There are many other instructions out there (several listed here) but this is by far the easiest to follow and the only one I found that actually works with php 5 and iis 6. http://www.tjitjing.com/blog /2006/05/php5-with-iis6-on-windows-server2003.html (Updated with new/corrected url to original note by John Kerner on 20-Apr2005 03:23 Had to put a space after blog in url to be able to post note - it does wrap fine due to all dashes but refuses to be submitted)
winterspan ! "T ! & m a i l . /C/'/4 IO-$ay-?JJN JO:<@

READ HERE If installing PHP 5.x on Windows Server 2003 / IIS 6.x ... It was extremely frustrating getting this to work, so hopefully my struggle will allow others to do this the *easy* way. BEFORE installing PHP 5 from a web tutorial (a good one found here: http://www.peterguy.com/php/install_IIS6.html) You need to READ THESE TIPS: #Necessary Permissions For WinServer 2003 / IIS6.0# These are the permission settings I found to work well with good security: NTFS permissions (right-click file or folder, select preferences, go to security tab) 1) PHP Install folder -> You need to give NT account: 'Network Service' read/execute permissions on the 'php' install folder (e.g., C:\\PHP). If you have a TMP or SESSION folder within the main PHP folder, you need to give account 'Network Service' read/execute AND write access on those folders. *(You DO NOT need to give the anonymous internet user account: 'IUSR_[name]' ANY permissions on the PHP INSTALL files themselves. )* 2) You DO need to give account: 'IUSR_name' Read/execute permissions on the actual WWW root folder and web .php files (if you want to apply to all sites) or each websites WWW root and .php files if running multiple sites. 3) Within the IIS 6.0 console itself, in the website's preferences (right click on ind. site or 'websites' node to apply to all sites -> select preferences) on the 'Directory Security' tab -> click edit, and if you wish to allow anonymous access to your site, check the anonymous access box and be sure to enter account: 'IUSR_name'. 4) *MOST IMPORTANT* As mentioned by a few others, install php and configure the php.ini WITH NO EXTENSIONS AT FIRST. The reason being if one of the extensions fail, the error dialog will pop up OUTSIDE of a terminal services window (remote desktop). So you will NOT BE ABLE to click on the error, and the websites php file you are trying to load in your browser will hang indefinately (after having this happen for 12 hours I almost went insane trying to figure out the problem) LOL. Then when you have successfully loaded a test php page in the browser, go back to the php.ini file and add extensions in one at a time. If YOU have any tips I haven't included, email me. Again, I am not a professional, still a student in learning. :) Now that you have read that, go back to the link I placed near the top, and follow his tutorial for general installation/setup.
*estor Custodio J:-$ay-?JJN JA::J

If the path to your PHP directory has spaces (e.g. "C:\\Program Files\\PHP") and IIS gives a 500+ error or responds with "The specified module could not be found." when you try to run a PHP script, try changing the ISAPI DLL's path in IIS (in the "Home Directory" tab, under "Configuration...") to the 8.3-equivalent path. That is, use C:\\PROGRA~1\\PHP\\php5isapi.dll instead of "C:\\Program Files\\PHP\\php5isapi.dll".
c>b> at hotmail dot com J?-$ay-?JJN J::<:

Notes on configuring IIS and PHP to use Oracle are at http://blogs.oracle.com/opal/2006/05/01#a24


Cam 4c<e# ?J-(pr-?JJN JB::A

If you are using Application Pool Isolation and you're trying to get PHP to run as CGI and you're getting 403 errors, try looking at this article (watch the word wrap): http://www.servertastic.com/articles/2005/11/ unable-to-run-perl-or-php-in-application-pool-isolation/
.mu&Wimp at smu&wimp dot com ?J-(pr-?JJN J?:?O

If you make changes to your PHP.ini file, consider the following. (I'm running IIS5 on W2K server. I don't know about 2K3) PHP will not "take" the changes until the webserver is restarted, and that doesn't mean through the MMC. Usually folks just reboot. But you can also use the following commands, for a much faster "turnaround". At a command line prompt, type: iisreset /stop and that will stop the webserver service. net start w3svc and that will start the webserver service again. MUCH faster than a reboot, and you can check your changes faster as a result with the old: <?php> phpinfo(); ?> in your page somewhere. I wish I could remember where I read this tip; it isn't anything I came up with...
rat;inson at tbs!ltd dot co dot u; J:-(pr-?JJN J<:?A

Then type:

When installing onto the Windows IIS platform, ensure you add the PHPRC Server Variable to point to your PHP.INI file. Also, add '.INI' to the FILEEXT Server Variable. Failure to add these could stop the PHP engine being able to find your PHP.INI file, and none of your modifications will be read. Rob.
<aldinei B. ?I-$ar-?JJN JI:I@

If you get problems with ISS 6 and PHP try this: http://www.visualwin.com/PHP-ISAPI/ I've tried to install in a different folder than c:\php but when you add the application extension mapping the ISS does not accept a path with spaces (like c:\program files\php).
niatech JI-$ar-?JJN JA:BN

Thought someone would save some time and headaches by using this post. Our tech department is migrating to Windows 2003 Server and they have some complex security implementations between our Web Servers and our Application (COM) servers. If you have this type of scenario and are receiving the "Warning (null)(): Unable to lookup.... Access is denied." error, it is because the "Identity" in the Web Server's application pool does not have sufficient permissions to connect to the Application (COM) Server. To fix this: - create a new Application Pool - right click the new pool and select "properties" - click on the "Identity" tab - change the permissions from "Network Service" to a user on the Web Server who has access to call the Application (COM) server. - right click the application pool - click "start" - right click your web site - click on the "Home Directory" tab - change the application pool to the new application pool you've just created. - restart IIS Hopefully this will save someone some time and headaches.
mach ?A-9e"-?JJN JN:I<

I've installed Apache + PHP on a Windows machine of which I'm not an administrator. I found out it was necessary to change the permissions of the httpd.conf file on C:\Program Files\Apache Group\Apache\conf in order to have everything working. Since I'm also using cygwin this was simply done with: >chmod 755 httpd.conf.
lu;as= at s=osta; dot bi= I<--an-?JJN J@:<J

You can have multiple versions of PHP running on the same Apache server. I have seen many different solutions pointing at achieving this, but most of them required installing additional instances of Apache, redirecting ports/hosts, etc., which was not satisfying for me. Finally, I have come up with the simplest solution I've seen so far, limited to reconfiguring Apache's httpd.conf. My goal is to have PHP5 as the default scripting language for .php files in my DocumentRoot (which is in my case d:/htdocs), and PHP4 for specified DocumentRoot subdirectories. Here it is (Apache's httpd.conf contents): --------------------------# replace with your PHP4 directory ScriptAlias /php4/ "c:/usr/php4/" # replace with your PHP5 directory ScriptAlias /php5/ "c:/usr/php5/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php5/php-cgi.exe" # populate this for every directory with PHP4 code <Directory "d:/htdocs/some_subdir"> Action application/x-httpd-php "/php4/php.exe" # directory where your PHP4 php.ini file is located at SetEnv PHPRC "c:/usr/php4" </Directory> # remember to put this section below the above

<Directory "d:/htdocs"> # directory where your PHP5 php.ini file is located at SetEnv PHPRC "c:/usr/php5" </Directory> --------------------------This solution is not limited to having only two parallel versions of PHP. You can play with httpd.conf contents to have as many PHP versions configured as you want. You can also use multiple php.ini configuration files for the same PHP version (but for different DocumentRoot subfolders), which might be useful in some cases. Remember to put your php.ini files in directories specified in lines "SetEnv PHPRC...", and make sure that there's no php.ini files in other directories (such as c:\windows in Windows). And finally, as you can see, I run PHP in CGI mode. This has its advantages and limitations. If you have to run PHP as Apache module, then... sorry you have to use other solution (the best advice as always is: Google it!). Hope this helps someone.
phil at pelanne dot com J<--an-?JJN JO:??

For those of you trying to install PHP 4 and PHP 5 concurrently on a windows 2003 box, there is just one rule you need to adhere to in order to make it work: - Don't have either of them in c:\php\. - Don't have a php.ini in your system32 directory. Put PHP 4 into a directory called c:\php4\. Put its php.ini in there, and make sure all the paths reflect the c:\php4 directory. Likewise, put PHP 5 into a directory called c:\php5\. Put its php.ini in there, and make sure all the paths reflect the c:\php5 directory. Add them as allowed script mappings in your iis extensions area, and have fun!
cormierma8at8csdcso.on.ca ?I-1ec-?JJ< JI:B:

Note to windows server 2003 users If you install php5 ISAPI on windows server 2003 / IIS and keep getting a 404 when you try to view a php script don`t just activate "all unknown ISAPI extensions" but also activate "All Unknown CGI Extensions".
Ce1her Fo=;ur IB-Oct-?JJ< JN:B@

I've installed php 5.0.5 with the ISAPI module, as the isapi dll file (php5isapi.dll) resides in the php root directory, I didn't have trouble in my installation (In php4 this dll file is in sapi directory and it should be moved to php root directory). I changed some of my settings in php.ini file and restart IIS Web site,but my changes weren't applied. Then I go to Control Panel>Administrative Tools>Services and restart the IIS Admin Service. Everything worked like a charm...
william ;eith ?A- ep-?JJ< JB:<I

Dirt Simple Install Guide For PHP5/W2K Servers For those of us out there who still have 2K servers, this is a great 3 min step by step to get you up and running.

http://www.onlamp.com/pub/a/php/2000/12/14/php_admin.html Thanks to it's author, Darrell Brogdon!


thedeadraptor$@@@ at #ahoo dot com BJ-(u!-?JJ< JA:J?

Note regarding PHP4 Installation on IIS5 + Win2K Tip: Don't install PHP4 on Directories with spaces in between. I've had problems Installing PHP 4.0.0 on IIS5, Win2k's default web server, spanish version (I live in Colombia). I've had HTTP 500 Errors and I followed all instructions step by step, but nothing seemed to work. I solved the problem eventually, and I think it had something to do with the fact that I have installed PHP4 manually and placed it in the directory "C:\Archivos de programa\php-4.4.0-Win32" ('Archivos de programa' stands for 'Program Files'), a directory with spaces in between. When I added the application mappings for "C:\Archivos de programa\php4.4.0-Win32/sapi/php4isapi.php", An error would ocurr and a message along with it: "Escriba una ruta de acceso valida", as in "Write a valid access rute", as in "I can't find the file". I thought i had it when I encapsulated it with Doublequotes ("), but that didn't work either. As a final long shot, I copied the php4isapi.dll to the windows/system32 directory and 'WALA!' It worked. I'm not sure, but i suspect that it had to do with spaces in between directory names, so avoid those, or copy the isapi module to another directory. Hope this helps someone!
5ou& Frower ?N-(u!-?JJ< J@:::

Kudos to John Kerner's recommendation (above) to use: http://www.tjitjing.com/code/article.php?subject=php5_iis6_install for installation on Windows. I followed the instructions with Windows XP Professional on a dev machine, rather than Windows 2003 Server as described in the note. Only difference was to omit his step 4.a. Worked like a champ!
wappa at hotmail dotandthe;an&aroo com J:-(u!-?JJ< JA:IN

Don't forget if you are getting ACL exceptions to reading the test php page you have created you MUST share the PHP directory or the resources PHP uses to "everyone" but remember use restricted access for security.
>p at iticonsultin& dot nl ?B--ul-?JJ< JO::?

If you get 404 page not found on Windows/IIS5, have a look at C:\SYSTEM32\INETSRV\URLSCAN There is a .ini file there that prevents some files from being served by IIS, even if they exist, instead IIS will give a 404. The urlscan logfile (same place) should give you some insight into what parameter is preventing a page from loading, if any.
,ero= Nahid JA--un-?JJ< JI::I

In order to run php scripts with php.exe CGI instead of php4isapi.dll under IIS, following steps can be followed. i) Add a web service extension for PHP using IIS manager. Choose a web service extension name like 'PHP' and add your php.exe path in the 'file location' while adding the required file e.g. 'C:\php\php.exe' in the Add extension dialog box. Don't forget to 'Allow' the extension file.

ii) Open php.ini file located at %systemroot%. Set the following variables to the shown values. cgi.force_redirect = 0 cgi.redirect_status_env = ENV_VAR_NAME iii) In your websites, add Application Mapping for '.php' and set the executable path to your php.exe file path. You can test whether PHP is running or not and other PHP settings using the following simple PHP script. <?php> phpinfo(); ?> Feroz Zahid ferozzahid [_at_] usa [_dot_] [_com_]
ste1e at lonetree dott com J?--un-?JJ< J<:<N

Hello all. Well, I'm an experienced iis admin, but I tell you, I had a devil of a time getting it to run correctly. My issue was that I was trying to do everything via term services...use this link http://www.peterguy.com/php/install_IIS6.html to view some seriously interesting notes on this. This guy's info was SPOT ON and worked perfectly for me. Don't forget to give Network Service group read/execute access to your web content...
donald at netri1er dot net J:-$ay-?JJ< JI:?I

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.
&ar# at &ar#slittlecompan# dot com ?N-(pr-?JJ< JI:<@

php compiled with eapi on windows. that would work for the

Spend hours trying to find something

"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
Bohn Oerner ?J-(pr-?JJ< JB:?B

This is a great instruction for installing php 5 on a windows 2003/iis 6 server. There are many other instructions out there (several listed here)

but this is by far the easiest to follow and the only one I found that actually works with php 5 and iis 6. http://www.tjitjing.com/code/article.php?subject=php5_iis6_install
philip J:-$ar-?JJ< IJ:<I

Installation instructions for PHP+Windows with the Jigsaw web server can be found here: * http://www.circle.ch/servers/
do#ouunderstand at &mail dot com JB-$ar-?JJ< J::BI

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).
.te1e * J?-9e"-?JJ< JA:BB

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
claudio8>1t at hotmail dot com I:--an-?JJ< J::BA

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 phpcgi.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 mo1e dash media dot com JO--an-?JJ< J::BO

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.
ntadmin at aplus dot net ?@-(u!-?JJ: II:<B

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.
.ean Foulter I<-(pr-?JJ: J?:JJ

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.
+uis 5 ?@-$ar-?JJ: J:::O

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 wanna call and always 2-Click on (default) "extension name" field, please enter "PHP" (or what ever you it) Other more conservative admins will say call it what it is input ".php". Its up to you! the "add" button and browse to the php4ts.dll file on your c:\PHP 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 JO-$ar-?JJ: J<:<@

Guys, I've just updated my page "Compiling Apache, PHP and foreign modules on a Win32 platform" to cover the process for Microsoft Visual Studio .NET 2003 users. The page is located at: http://www.schau.com/apachephp/apachephpwin32/index.html Enjoy. Kind regards, Brian
ferchland at computer!;ontor dot de JN-9e"-?JJ: JA:<I

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.
un&di at hotmail dot com ?I--an-?JJ: JI:BN

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.
#ellowduc;lin&s at hotmail dot com I:-$ay-?JJB JA:?O

Very readable article on installing php on windows http://www.macromedia.com/devnet/mx/dreamweaver/articles/php_iis.html


spf at users dot sf dot net IO-(u!-?JJ? JA:<<

To allow acWEB.sf.net win32-webserver and Eserv 2.98 (www.eserv.ru) webserver 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 swic; at pantellos dot com I:-$ar-?JJ? JO:BN

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.
mi;e at schild dot com BI--ul-?JJJ IJ:::

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 webdefault-directory a virtual directory with all possible rights.<br> On my system it works now!

4anual Installation .teps


#his install !uide will help you manually install and confi!ure PHP with a we" server on $icrosoft Windows& #o !et started you0ll need to download the Cip "inary distri"ution from the downloads pa!e at Edownloads&php& (lthou!h there are many all-in-one installation *its' and we also distri"ute a PHP installer for $icrosoft Windows' we recommend you ta*e the time to setup PHP yourself as this will provide you with a "etter understandin! of the system' and ena"les you to install PHP extensions easily when needed& /p&radin& from a pre1ious PHP 1ersion: Previous editions of the manual su!!est movin! various ini and 1%% files into your / #;$ (i&e& C:\WINDOWS) folder and while this simplifies the installation procedure it ma*es up!radin! difficult& We advise you remove all of these files (li*e php.ini and PHP related 1%%s from the Windows / #;$ folder) "efore movin! on with a new PHP installation& 4e sure to "ac*up these files as you mi!ht "rea* the entire system& #he old php.ini mi!ht "e useful in settin! up the new PHP as well& (nd as you0ll soon learn' the preferred method for installin! PHP is to *eep all PHP related files in one directory and have this directory availa"le to your systems P(#H& 45"C re9uirements: .f you use $icrosoft W' do:s LM/NT< download the latest version of the $icrosoft 1ata (ccess +omponents ($1(+) for your platform& $1(+ is availa"le at http:EEmsdn&microsoft&comEdataE& #his reDuirement exists "ecause O14+ is "uilt into the distri"uted Windows "inaries& #he followin! steps should "e completed on all installations "efore any server specific instructions are performed: ;xtract the distri"ution file into a directory of your choice& .f you are installin! PHP :' extract to C:\' as the Cip file expands to a foldername li*e php-4.3.7-Win32& .f you are installin! PHP <' extract to C:\php as the Cip file doesn0t expand as in PHP :& /ou may choose a different location "ut do not have spaces in the path (li*e C:\Program Files\PHP) as some we" servers will crash if you do& #he directory structure extracted from the Cip is different for PHP versions : and < and loo* li*e as follows: E ample 6!1. PHP 2 pac;a&e structure

c:\php | +--cli | | | |-php.exe scripting | +--dlls | | | |-expat.dll | | | |-fdftk.dll | | | |-... | +--extensions | | | |-php_bz2.dll | | | |-php_cpdf.dll

-- CLI executable - ONLY for commandline

-- support DLLs required by some extensions

-- extension DLLs for PHP

| | | |-.. | +--mibs | +--openssl | +--pdf-related | +--sapi | | | |-php4apache.dll | | | |-php4apache2.dll | | | |-.. | +--PEAR | | |-go-pear.bat | |-.. | |-php.exe | |-.. | |-php.ini-dist | |-php.ini-recommended | |-php4ts.dll | |-...
Or:

-- support files for SNMP -- support files for Openssl -- support files for PDF -- SAPI (server module support) DLLs

-- initial copy of PEAR

-- PEAR setup script

-- CGI executable

-- default php.ini settings -- recommended php.ini settings -- core PHP DLL

E ample 6!$. PHP 3 pac;a&e structure

c:\php | +--dev | | | |-php5ts.lib | +--ext | | | |-php_bz2.dll | |

-- extension DLLs for PHP

| |-php_cpdf.dll | | | |-.. | +--extras | | | +--mibs | | | +--openssl | | | +--pdf-related | | | |-mime.magic | +--pear | | |-go-pear.bat | |-fdftk.dll | |-.. | |-php-cgi.exe | |-php-win.exe prompt | |-php.exe scripting | |-.. | |-php.ini-dist | |-php.ini-recommended | |-php5activescript.dll | |-php5apache.dll | |-php5apache2.dll | |-.. | |-php5ts.dll | |-...

-- support files for SNMP -- support files for Openssl -- support files for PDF

-- initial copy of PEAR

-- PEAR setup script

-- CGI executable -- executes scripts without an opened command

-- CLI executable - ONLY for command line

-- default php.ini settings -- recommended php.ini settings

-- core PHP DLL

)otice the differences and similarities& 4oth PHP : and PHP < have a +3. executa"le' a +%. executa"le' and server modules' "ut they are located in different folders andEor have different names& While PHP : pac*a!es have the server modules in the sapi folder' PHP < distri"utions have no such directory and

instead they0re in the PHP folder root& #he supportin! 1%%s for the PHP < extensions are also not in a seperate directory& *ote: .n PHP :' you should move all files located in the dll and sapi folders to the main folder (e&!& C:\php)& Here is a list of server modules shipped with PHP : and PHP <:

sapi/php4activescript.dll (php5activescript.dll) - (ctive


em"ed PHP in your Windows applications&

cript en!ine' allowin! you to

sapi/php4apache.dll (php5apache.dll) - (pache I&B&x module& sapi/php4apache2.dll (php5apache2.dll) - (pache ?&J&x module& sapi/php4isapi.dll (php5isapi.dll) - . (P. $odule for . (P. compliant we" servers li*e ..
:&JEPW :&J or newer&

sapi/php4nsapi.dll (php5nsapi.dll) - unEiPlanetE)etscape server module& sapi/php4pi3web.dll (no equivalent in PHP 5) - PiBWe" server module&

erver modules provide si!nificantly "etter performance and additional functionality compared to the +3. "inary& #he +%. version is desi!ned to let you use PHP for command line scriptin!& $ore information a"out +%. is availa"le in the chapter a"out usin! PHP from the command line& Warnin& #he (P. modules have "een si!nificantly improved as of the :&I release' however' in older systems you may encounter server errors or other server modules failin!' such as ( P& #he +3. and +%. "inaries' and the we" server modules all reDuire the php4ts.dll (php5ts.dll) file to "e availa"le to them& /ou have to ma*e sure that this file can "e found "y your PHP installation& #he search order for this 1%% is as follows:

#he same directory from where (e&!&

php.exe is called' or in case you use a (P. module' the we" server0s directory C:\Program Files\Apache Group\Apache2\bin)&

(ny directory in your Windows -.TH environment varia"le&

#o ma*e php4ts.dll E php5ts.dll availa"le you have three options: copy the file to the Windows system directory' copy the file to the we" server0s directory' or add your PHP directory' C:\php to the -.TH& 9or "etter maintenance' we advise you to follow the last option' add C:\php to the -.TH' "ecause it will "e simpler to up!rade PHP in the future& 2ead more a"out how to add your PHP directory to -.TH in the correspondin! 9(= entry (and then don0t for!et to restart the computer - lo!off isn0t enou!h)& #he next step is to set up a valid confi!uration file for PHP' php.ini& #here are two ini files distri"uted in the Cip file' php.ini-dist and php.ini-recommended& We advise you to use php.inirecommended' "ecause we optimiCed the default settin!s in this file for performance' and security& 2ead this well documented file carefully "ecause it has chan!es from php.ini-dist that will drastically affect your setup& ome examples are displayHerrors "ein! o99 and ma!icHDuotesH!pc "ein! o99& .n addition to readin! these' study the ini settin!s and set every element manually yourself& .f you would li*e to achieve the "est security' then this is the way for you' althou!h PHP wor*s fine with these default ini files& +opy your chosen ini-file to a directory that PHP is a"le to find and rename it to php.ini& PHP searches for php.ini in the locations descri"ed in the ection called The co 9'4#rat'o 9'le in +hapter O section& .f you are runnin! (pache ?' the simpler option is to use the PHP.ni1ir directive (read the installation on (pache ? pa!e)' otherwise your "est option is to set the -H-RC environment varia"le& #his process is explained in the followin! 9(= entry& *ote: .f you0re usin! )#9 on Windows )#' ?JJJ' 8P or ?JJB' ma*e sure that the user runnin! the we" server has read permissions to your php.ini (e&!& ma*e it reada"le "y ;veryone)& #he followin! steps are optional:

;dit your new php.ini file& .f you plan to use OmniH##Pd' do not follow the next step& your we" servers documentHroot& 9or example:

et the docHroot to point to

doc_root = c:\inetpub\wwwroot // for IIS/PWS

doc_root = c:\apache\htdocs // for Apache

+hoose the extensions you would li*e to load when PHP starts& ee the section a"out Windows extensions' a"out how to set up one' and what is already "uilt in& )ote that on a new installation it is advisa"le to first !et PHP wor*in! and tested without any extensions "efore ena"lin! them in php.ini& On PW and .. ' you can set the "rowscap confi!uration settin! to point to:

c:\windows\system\inetsrv\browscap.ini on Windows OxE$e' c:\winnt\system32\inetsrv\browscap.ini on )#E?JJJ' and c:\windows\system32\inetsrv\browscap.ini on 8P& 9or an up-to-date browscap.ini'
read the followin! 9(=&

PHP is now setup on your system& #he next step is to choose a we" server' and ena"le it to run PHP& +hoose a we"server from the ta"le of contents&

4anual Installation .teps Bason -reene J:-$ay-?JJN JN:JN

add a note 7ser +ontri"uted )otes

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.
Fen JN-(pr-?JJN JB:I@

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 IB-9e"-?JJN JO:<:

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 .er1er $@@0 ( 62 bits) P II. 6.@ BI--an-?JJN JB:IN

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 ?N-1ec-?JJ< JN:JO

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 A some place J:-)ov-?JJ< JA:<@

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
Fill dot Hoo; at -mail dot com IA- ep-?JJ< IJ:JO

doc_root = ".;c:\inetpub\wwwroot" does seem to work with virtual websites. This might be a better option then commenting out the line.
Bason JO- ep-?JJ< J::<:

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 IJ--ul-?JJ< JO:I@

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 (\)
thierr# dot bo at n e t c o u r r i e r dot com ?J-1ec-?JJ: J::<J

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.
cp= at a;i;!ffm dot de IO-1ec-?JJ: IJ:?:

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.
mic2$ at users dot sourcefor&e dot net BJ-)ov-?JJ: JA:JO

To install PHP as CGI under the Tcl Webserver Tclhttpd follow the instructions at: http://wiki.tcl.tk/12130
chuacheehow at &mail dot com JA-Oct-?JJ: J<:<<

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 J@-Oct-?JJ: JN:?O

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 ?O-(u!-?JJ: JI::B

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.

"cti1e.cript
#his section contains notes specific to the (ctive cript installation& (ctive cript is a windows only (P. that ena"les you to use PHP script in any (ctive cript compliant host' li*e Windows cript Host' ( PE( P&);#' Windows cript +omponents or $icrosoft criptlet control& (s of PHP <&J&I' (ctive cript has "een moved to the P;+% repository& /ou may download this P;+% extension 1%% from the PHP 1ownloads pa!e or at http:EEsnaps&php&netE& *ote: /ou should read the manual installation steps firstF (fter installin! PHP' you should download the (ctive cript 1%% (php5activescript.dll) and place it in the main PHP folder (e&!& C:\php)& (fter havin! all the files needed' you must re!ister the 1%% on your system& #o achieve this' open a +ommand Prompt window (located in the tart $enu)& #hen !o to your PHP directory "y typin! somethin! li*e cd C:Nphp& #o re!ister the 1%% ,ust type re4s?rO2 php>act'?escr'pt.dll& #o test if (ctive cript is wor*in!' create a new file' named test.:s9 (the extension is very important) and type:

<job id="test"> <script language="PHPScript"> $WScript->Echo("Hello World!"); </script> </job>


ave and dou"le-clic* on the file& .f you receive a little window sayin! "Hello WorldF" you0re done& *ote: .n PHP :' the en!ine was named 0(ctivePHP0' so if you are usin! PHP :' you should replace 0PHP cript0 with 0(ctivePHP0 in the a"ove example& *ote: (ctive cript doesn0t use the default php.ini file& .nstead' it will loo* only in the same directory as the &exe that caused it to load& /ou should create phpactivescript.ini and place it in that folder' if you wish to load extensions' etc&

"cti1e.cript &arfiel8fr at tiscali dot fr II-$ay-?JJ< JO:JN

add a note 7ser +ontri"uted )otes

There is another way to execute a PHP ActiveScript: 1/ In explorer, open menu "Tools/Folder Options" 2/ Go to tab "File Type" 3/ Click on "New" button and enter a file extension ( PHS for my sample ), you can also select "PHPScript" in "Advanced" button. Then OK, a new file extension is registered. 4/ In tab "File Type" select the new extension and click on button "Advanced". A new dialog box is open. 5/ Click on "New" button and fill edit box with: Action: Run Application to use: C:\WIN2K\system32\wscript.exe //E:PHPScript "%1" "%2" That's all !! Now, your code don't need XML tag at the begining. Hello work in test.phs

will be: $WScript->Echo("Bonjour le monde !");

4icrosoft II. / PW.


#his section contains notes and hints specific to .. ($icrosoft .nternet .nformation erver)&

Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s&

-eneral considerations for all installations of PHP with II. or PW.



9irst' read the $anual .nstallation .nstructions& 1o not s*ip this step as it provides crucial information for installin! PHP on Windows& +3. users must set the c!i&forceHredirect PHP directive to 0 inside php.ini& 2ead the faD on c!i&forceHredirect for important details& (lso' +3. users may want to set the c!i&redirectHstatusHenv directive& When usin! directives' "e sure these directives aren0t commented out inside php.ini& #he PHP : +3. is named the +3.&

php.exe while in PHP < it0s php-cgi.exe& .n PHP <' php.exe is the +%.' and not

$odify the Windows -.TH environment varia"le to include the PHP directory& #his way the PHP 1%% files' PHP executa"les' and php.ini can all remain in the PHP directory without clutterin! up the Windows system directory& 9or more details' see the 9(= on ettin! the P(#H& #he .. user (usually .7 2H$(+H.);)($;) needs permission to read various files and directories' such as

php.ini' docroot' and the session tmp directory&


4e sure the extensionHdir and docHroot PHP directives are appropriately set in the system that PHP is "ein! installed on& .n PHP :' the extensionHdir is

php.ini& #hese directives depend on extensions while with PHP < it0s ext&

o' an example PHP < extensionsHdir value is "c:\php\ext" and an example .. docHroot value is "c:\Inetpub\wwwroot"& PHP extension 1%% files' such as php_mysql.dll and php_curl.dll' are found in the Cip pac*a!e of the PHP download (not the PHP installer)& .n PHP <' many extensions are part of P;+% and can "e downloaded in the "+ollection of P;+% modules" pac*a!e& 9iles such as php_zip.dll and php_ssh2.dll& 1ownload PHP files here& When definin! the executa"le' the 0chec* that file exists0 "ox may also "e chec*ed& 9or a small performance penalty' the .. (or PW ) will chec* that the script file exists and sort out authentication "efore firin! up PHP& #his means that the we" server will provide sensi"le :J: style error messa!es instead of +3. errors complainin! that PHP did not output any data&

Windows *T/$@@ /GP and II. 2 or newer


PHP may "e installed as a +3. "inary' or with the . (P. module& .n either case' you need to start the $icrosoft $ana!ement +onsole (may appear as 0.nternet ervices $ana!er0' either in your Windows )# :&J Option Pac* "ranch or the +ontrol PanelQT(dministrative #ools under Windows ?JJJE8P)& #hen ri!ht clic* on your We" server node (this will most pro"a"ly appear as 01efault We" erver0)' and select 0Properties0& .f you want to use the +3. "inary' do the followin!:

7nder 0Home 1irectory0' 0>irtual 1irectory0' or 01irectory0' do the followin!: +han!e the ;xecute Permissions to 0 cripts only0 +lic* on the 0+onfi!uration0 "utton' and choose the (pplication $appin!s ta"& +lic* (dd and set the ;xecuta"le path to the appropriate +3. file& (n example PHP < value is: C:\php\php-cgi.exe upply .php as the extension& %eave 0$ethod exclusions0 "lan*' and chec* the 0 cript en!ine0 chec*"ox& )ow' clic* O6 a few times& et up the appropriate security& (#his is done in .nternet ervice $ana!er)' and if your )# erver uses )#9 system' add execute ri!hts for .H7 2H to the directory that contains php.exe E php-cgi.exe& file

#o use the . (P. module' do the followin!:

.f you don0t want to perform H##P (uthentication usin! PHP' you can (and should) s*ip this step& 7nder . (P. 9ilters' add a new . (P. filter& 7se PHP as the filter name' and supply a path to the php4isapi.dll E

php5isapi.dll&
7nder 0Home 1irectory0' 0>irtual 1irectory0' or 01irectory0' do the followin!: +han!e the ;xecute Permissions to 0 cripts only0 +lic* on the 0+onfi!uration0 "utton' and choose the (pplication $appin!s ta"& +lic* (dd and set the ;xecuta"le path to the appropriate . (P. 1%%& (n example PHP < value is: C:\php\php5isapi.dll upply .php as the extension& %eave 0$ethod exclusions0 "lan*' and chec* the 0 cript en!ine0 chec*"ox& )ow' clic* O6 a few times& top .. completely ();# #OP iisadmin)

tart ..

a!ain ();#

#(2# wBsvc)

With .. N (?JJB erver)' open up the .. $ana!er' !o to We" ervice ;xtensions' choose "(dd a new We" service extension"' enter in a name such as PHP' choose the (dd "utton and for the value "rowse to either the . (P. file (php4isapi.dll or php5isapi.dll) or +3. (php.exe or php-cgi.exe) then chec* " et extension status to (llowed" and clic* O6& .n order to use index.php as a default content pa!e' do the followin!: 9rom within the 1ocuments ta"' choose (dd& #ype in index.php and clic* O6& (d,ust the order "y choosin! $ove 7p or $ove 1own& #his is similar to settin! 1irectory.ndex with (pache& #he steps a"ove must "e repeated for each extension that is to "e associated with PHP scripts& .php is the most common althou!h .phpO may "e reDuired for le!acy applications& .f you experience IJJW +P7 usa!e after some time' turn off the .. settin! Cache 2).-2 .ppl'cat'o &

Windows and PW. 2


PW : does not support . (P.' only PHP +3. should "e used&

;dit the enclosed

pws-php4cgi.reg E pws-php5cgi.reg file (loo* into the

(P. folder for PHP :' or in

the main folder for PHP <) to reflect the location of your php.exe E php-cgi.exe& 4ac*slashes should "e escaped' for example: +H5ED_7OC.7_M.CH2NEN)D)TEMNC#rre tCo trol)etN)er?'cesN:Os?cNpara3etersN)cr'pt Map0 E.phpE;EC:NNphpNNphp.e"eE (chan!e to C:NNphpNNphp=c4'.e"e if you are usin! PHP <) )ow mer!e this re!istery file into your systemM you may do this "y dou"le-clic*in! it&

.n the PW $ana!er' ri!ht clic* on a !iven directory you want to add PHP support to' and select Properties& +hec* the 0;xecute0 chec*"ox' and confirm&

Windows and PW./II. 0


#he recommended method for confi!urin! these servers is to use the 2;3 file included with the distri"ution (pws-php4cgi.reg in the (P. folder for PHP :' or pws-php5cgi.reg in the main folder for PHP <)& /ou may want to edit this file and ma*e sure the extensions and PHP install directories match your confi!uration& Or you can follow the steps "elow to do it manually& Warnin& #hese steps involve wor*in! directly with the Windows re!istry& One error here can leave your system in an unsta"le state& We hi!hly recommend that you "ac* up your re!istry first& #he PHP 1evelopment team will not "e held responsi"le if you dama!e your re!istry&

2un 2e!edit& )avi!ate to: H5ED_7OC.7_M.CH2NE /)Aste3 /C#rre tCo trol)et /)er?'ces /WO)?c /-ara3eters /)cr'ptMap& On the edit menu select: Ne:=&)tr' 4 *al#e& #ype in the extension you wish to use for your php scripts& 9or example .php 1ou"le clic* on the new strin! value and enter the path to

php.exe in the value data field& ex: C:\php\php.exe "%s" %s for PHP :' or C:\php\php-cgi.exe "%s" %s for PHP <&
2epeat these steps for each extension you wish to associate with PHP scripts&

#he followin! steps do not affect the we" server installation and only apply if you want your PHP scripts to "e executed when they are run from the command line (ex& run C:\myscripts\test.php) or "y dou"le clic*in! on them in a directory viewer window& /ou may wish to s*ip these steps as you mi!ht prefer the PHP files to load into a text editor when you dou"le clic* on them&

)avi!ate to: H5ED_C7.))E)_ROOT On the edit menu select: Ne:=&5eA& )ame the *ey to the extension you setup in the previous section& ex: .php Hi!hli!ht the new *ey and in the ri!ht side pane' dou"le clic* the "default value" and enter php9'le& 2epeat the last step for each extension you set up in the previous section& )ow create another Ne:=&5eA under H5ED_C7.))E)_ROOT and name it php9'le& Hi!hli!ht the new *ey php9'le and in the ri!ht side pane' dou"le clic* the "default value" and enter -H- )cr'pt& 2i!ht clic* on the php9'le *ey and select Ne:=&5eA' name it )hell& 2i!ht clic* on the )hell *ey and select Ne:=&5eA' name it ope & 2i!ht clic* on the ope *ey and select Ne:=&5eA' name it co33a d&

Hi!hli!ht the new *ey co33a d and in the ri!ht side pane' dou"le clic* the "default value" and enter the path to php.exe& ex: c:NphpNphp.e"e =B P1& (don0t for!et the P1)& ;xit 2e!edit& .f usin! PW on Windows' re"oot to reload the re!istry&

PW and .. B users now have a fully operational system& .. 3enusa to confi!ure their script maps&

B users can use a nifty tool from

teven

4icrosoft II. / PW. sschefer at scheferonline dot net ?A-$ay-?JJN II:<N

add a note 7ser +ontri"uted )otes

I have sucessfully installed PHP 4 and 5 on every windows server version since 2000 (not NT4) and XP. It is simple but there are a couple of prerequisites that I've never seen mentioned. 1. Most of the problems folks are experiencing on the server side are .NET 2.0 induced. If you must run .NET 2.0 then you need dll's that were compiled with Visual Studio 8. The big push behind VS.8 and the Express editions is to get you off of PHP and onto C#. Keep that in mind when you develop apps. 2. You can run .NET 2.0 and Visual studio on XP with PHP and IIS if you install Visual Studio first. Visual studio installs its own dedicated version of IIS that works with .NET 2.0 but will not run php. After VS is installed go ahead and install the included XP version of IIS and configure your virtual sites with PHP. If you do it the other way around, VS will incorporate itself into the xp IIS and your PHP will probably not run. 3. Put the PHP ini file where windows wants it, in the (system root) "c:\windows" dir. If you do that, and you are using only the ISAPI dll's, you just need to change the ini file to point to the ext directory correctly and it will run fine. I usually do all the pathing recommendations and set phprc=(php directory) too. I also leave a copy of the current ini file in the php directory root just incase php forgets to consult with the OS before looking for something. Most of the problems with permissions are comming from .NET 2.0. You should never have to weaken security to get PHP to run. 4. Slightly out of scope but important nonetheless. If you do not run .NET 2.0, the ordering of your extensions (ie..mysql.dll, etc.) becomes far less important. You may see a hang occasionally but its rare. Hope this helps someone. Steve
le&olas33L8"T8users dot sourcefor&e.net I?-$ay-?JJN JO:J@

How to solve the nasty "permission denied" under IIS (Windows xp) From http://www.geocities.com/legolas.1558/php_iis_permission_denied.htm 1. Did you disable Simple File Sharing? From any folder click Tools -> Folder Options -> View (tab)-> (scroll the list and find "Simple File Sharing (reccomended)") UNTICK IT 2. Locate your localhost root directory, usually C:\InetPub\wwwroot\ 3. Open the Properties of the whole directory, in our case wwwroot 4. Click the Protection tab(where to manage user rights) 5. Click Add and then click Advanced (button in the bottom-left part of the window) 6. Click Find (the only enabled button between Columns and Stop) 7. Pick the user that starts with IUSR_ (which is the IIS default user) from the list Windows has kindly found for you 8. push OK twice 9. the new added IUSR_ will be selected, from the Authorizations list check Edit (to allow file creation/deletion) and Write (to allow file

modify) 10. click OK one more time to get back to your native folder
E1ilPuppet4aster ?B-$ar-?JJN J@:BO

After having recently gone through a long process of trial and error installing both php4 and php5 on a single machine under IIS. I eventually did get it working so I thought I'd share what I learnt. Basically, as far as I can tell there is no way to get both versions working using the ISAPI dlls unfortunately. You can however get them working using one as ISAPI and the other as CGI. And probably both as CGI too, although I didn't try that. You'll need to know how to do a manual install of PHP anyway, see the instructions for how to do that. Make sure you follow the steps about your PATH env variable and Allowing extensions on IIS 6. Keep your php.inis in the relevant php directory and make sure they are not in your windows or system32 folders. And all that other hoopla. The crucial part is your php.ini files. The problem being will look at your PHPRC setting and get the ini file path you'll end up with both versions running off the same INI The way around this is to use the CGI for one version and other. that both versions from that. So which is no good. ISAPI for the

The ISAPI dll never seems to look in it's own directory for the ini file, but the CGI exe does. You can use that quirk to your advantage by naming the INI file for the ISAPI version 'php-isapi.ini' and setting the PHPRC environment variable to that path. Then for the CGI version keep the php.ini in the same directory as php.exe. Then set your virtual server to use either the ISAPI module for one version, or the CGI module for the other version, and it should work. Test using phpinfo() to ensure each version is getting it's ini file from the correct place. Basically it seems that the ISAPI module will look in the path set in PHPRC first, and choose the php-isapi.ini file. The CGI module will look in PHPRC first too, but it upon seeing no php.ini it will then move on to search it's own directory, where it finds php.ini.
4artu ?B-$ar-?JJN J<:J@

I have fixed the 404 with this message found at google groups: ----------------------------------------------------------I could not get PHP pages to display in IIS 6 with Windows 2003, using the default install of the stable binaries from php.net. Here is the solution I found. The default install registers the .php extension as belonging to c:\php\php.exe. This is correct, but it's faster to use the ISAPI extension. To 1. 2. 3. 4. 5. 6. 6. do this, Open the IIS Management console Expand the server, right click on "Web Sites" and click Properties Open the "ISAPI Filters" foldertab Click Add Enter PHP in the Filter Name box. Click Browse and then Browse to your php4isapi.dll. Click ok -> Apply -> ok

... Once this is completed, your PHP scripts still won't run. The problem is that you have to define and enable PHP as a "Web Service Extension". To do this, 1. Open the IIS Management console

2. Expand the server, and expand the "Web Services Extensions" 3. Click "Add a new Web services Extension" 4. Enter PHP in the Extension Name box. 5. In the required files box, Browse to your php directory and add php4isapi.dll. 6. Click ok -> Apply -> ok Last but not least, You may or may not need to do the following, -Set the extensions path in the php.ini file if you are going to use any extensions , i.e. php_mssql.dll -I had to copy the php4isapi.dll from c:\php\isapi to c:\php, YMMV -Give the webserver user (IUSR_MACHINENAME in most cases) read and execute access to php4isapi.dll and php4ts.dll Good Luck, Ejay Hire EjayH...@hotmail.com ---------------------------------------------------------paul8noeldner at hotmail dot com JB-Oct-?JJ< J@:<A

PROBLEM PHP $DOCUMENT_ROOT was not set in IIS. ANALYSIS A Google search turned up a suggestion re using ISAPI instead of CGI. SOLUTION I did the fix per these suggested steps from Google search: 1 Downloaded PHP5 zip 2 Added ISAPI filter PHP5ISAPI.DLL named PHP 3 Changed document type .php to point at the PHP5ISAPI.DLL file instead of PHP.EXE. RESULT This worked - the php pages started picking up $DOCUMENT_ROOT as expected. General suggestion: Don't waste time with CGI, use ISAPI.
Bame= ?B- ep-?JJ< J<:?O

PHP 5, IIS 5, Win XP: One thing to note: if you run phpinfo() and the 'Configuration File (php.ini) Path' points to a directory and not the actual file (ie. C:\\windows instead of C:\\windows\\php.ini) this means that it is not using your php.ini file, it is using default settings. After spending hours searching forums the only thing that got it to work for me was to create a new environment system variable called 'PHPRC' and set it to the path where your php.ini is located (ie C:\\PHP) - simply adding C:\\PHP to the system path variable didn't do it. You have to reboot after this change of course. I'm not sure why this isn't more documented as from my searching there are quite a few people who experience this problem... hope this helps!
webwhamm#.com I<- ep-?JJ< J::<B

After installing PHP and running an http://localhost/test.php file in my browser, I encountered a COM Surrogate error. After some testing, I found that it was a result of un-checking the Cache ISAPI applications checkbox. Consequently, make sure that the Cache ISAPI applications checkbox has a check in it. To get to the checkbox go to: Control Panel>Administrative Tools>Internet Information Services When you are at the IIS window in the left navigational panel go to: Local Computer>Web Sites>Default Web Site Right-click on your default web site and select Properties. A Properties window appears. Select the Home Directory tab. Click on the Configuration... button. A Configuration window appears. Below the Mappings tab is the Cache ISAPI applications checkbox.

Again, make sure that the Cache ISAPI applications checkbox has a check in it. I hope this helps anybody else with a similar problem.
4ac Hinehart J@- ep-?JJ< JO:I:

"Click on the 'Configuration' button, and choose the Application Mappings tab. Click Add and set the Executable path to the appropriate CGI file. An example PHP 5 value is: C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method exclusions' blank, and check the 'Script engine' checkbox. Now, click OK a few times." When installing PHP 5 on IIS 6.0 and Windows 2003 I encountered problems with this instruction. I believe the root cause is that IIS requires the "scripts and executables" execute permission to be selected if the script engine has a .exe extension. However, there may have been additional problems. Even when selecting the "scripts and executables" execute permission I continually received HTTP Header errors. The resolution was to follow the instructions for use of php5isapi.dll. The .dll extension can be run with the "scripts only" execute permission. Also remember IIS 6.0 requires that you identify Web Extensions and Allow execution of those extensions.
peter at peter&u# dot com BI-$ar-?JJ< IJ::B

Installing PHP 5 on Windows Server 2003/IIS6 It has come to my attention that the link to my PHP installation guide in my posting of 07-Feb-2005 11:49 is a Bad Link. We don't like Bad Links. Here's the correct one: http://www.peterguy.com/php/install_IIS6.html Enjoy! -Peter
4arat IN-$ar-?JJ< JI:<J

The correct required NTFS ACL's are: - for the folder holding your PHP files: [Read] IUSR_servername [Read] IWAM_servername -for the folder holding the PHP executables: [Read] IUSR_servername
Person who wants I."PI 1ersion installer ?<-9e"-?JJ< JI:<O

Supplementation to the previous hint The environment is Windows 2003 Server/IIS 6/PHP 5. About IIS 6 of Windows XP. There is no 'IISEXT.VBS'. It seems not to have to add it to the Web enhancing (It is not an accurate intelligence ). Moreover, when the method argument of iis6 isapimap add is omitted, it becomes an error. Specify it following and specifying it. iis6isapimap add .PHP C:\PHP\php5isapi.dll GET,POST,HEAD Good Luck !

Person who wants I."PI 1ersion installer ?:-9e"-?JJ< JI:B:

Hint registered to IIS 6 as ISAPI without using GUI. (It is a machine translation from Japanese to English. ) [Method of addition to Web enhancing] 'IISEXT.VBS' is attached to IIS 6. <addition example> iisext /AddFile C:\PHP\php5isapi.dll 1 PHP 1 "PHP: Hypertext Preprocessor" <deletion example> iisext /RmFile C:\PHP\php5isapi.dll

[Method of adding extension to Application Mappings] To our regret, there is no good method in the standard. :-( The source code of C# program that is registered and deleted is presented in the mapping. (It is hoped that someone writes VBScript or the JScript version) <addition example> iis6isapimap add .PHP C:\PHP\php5isapi.dll < deletion example> iis6isapimap delete .PHP C# source code (Add 'System.DirectoryServices' to the reference) -----------------------------------------------------------using System; using System.Collections; using System.DirectoryServices; namespace IIS6ISAPIMAP { class StartClass { public static void print_man() { Console.WriteLine("IIS6ISAPIMAP [view|add|delete] <.ext> <ISAPI DLL PATH> (METHOD LIST)"); } [STAThread] static void Main(string[] args) { if ( args.GetLength(0) < 1 ) { print_man(); return; } System.DirectoryServices.DirectoryEntry dent = new DirectoryEntry("IIS://localhost/W3SVC/1/root"); ArrayList orglist = new ArrayList( dent.Properties["ScriptMaps"] ) ; if ( args[0].ToLower() == "view" ) { foreach(string s in orglist)

{ Console.WriteLine(s); } } else if ( args[0].ToLower() == "add" ) { if ( args.GetLength(0) < 3 ) { print_man(); } else { ArrayList newlist = new ArrayList(); string ext = args[1]; string path = args[2]; string methods = args.GetLength(0) < 4 ? "" : args[3]; string newmap = ext + "," + path + ",5," + methods; foreach(string s in orglist) { string [] tokn = s.Split(','); if ( tokn[0].ToLower() != ext.ToLower() ) { newlist.Add( s ); } } newlist.Add( newmap ); dent.Properties["ScriptMaps"].Value = newlist.ToArray(); dent.CommitChanges(); } } else if ( args[0].ToLower() == "delete" ) { if ( args.GetLength(0) < 2 ) { print_man(); } else { ArrayList newlist = new ArrayList(); string ext = args[1]; foreach(string s in orglist) { string [] tokn = s.Split(','); if ( tokn[0].ToLower() != ext.ToLower() ) { newlist.Add( s ); } } dent.Properties["ScriptMaps"].Value = newlist.ToArray(); dent.CommitChanges(); } } else { print_man(); } dent.Dispose(); } } }
php at at dou&dossett dot com JN--an-?JJ< II:J<

I had problems upgrading to 5.0.3 isapi on my IIS 6/Windows 2003 server. Most of the instructions I found said to give the IUSR account access to various files/folders. In my case I needed to give access to "Network Service" (not to be confused with just "Network"). 1. In IIS Admin, go to Application Pools 2. Right click on the pool your site is running under and click properties. 3. Go to the Identity tab and see what user is selected. 4. Give that user permissions to your php files/directory. Don't know if this will help anyone else, but thought I'd offer in case.
me&awhi=== at netscape dot com II-Oct-?JJ: J::IO

Path references (e.g. for browscap.ini) in php.ini MUST be enclosed with double-quotes (") instead of single-quotes(') for PHP to load correctly under IIS
paul at heisholt dot net BJ-(u!-?JJ: JI::B

There's a bug in IIS 5.1 which may prevent you from adding an Application Extension Mapping. If the OK button remains disabled after you've entered the Executable and the Extension, try this workaround provided by Microsoft: 1. Right-click the individual Web site or the Web Sites folder, and then click Properties. 2. On the Home Directory tab, click Configuration. 3. Under Application Configuration, click Add, and then click the Mappings tab. 4. With the Add/Edit Application Extension Mapping dialog box open, click Browse to select the .exe file or the .dll file from the local path on the Web server. Note: You must type the path to a valid file in the Executable text box or the OK button remains unavailable. The easiest way to make sure that you enter a valid path is to select the file by using the Browse button. 5. After the path appears in the Executable text box, click in the Executable text box to initialize the path. 6. Click in the Extension space, and then type the file name extension. Note: - You must enter the period (.) in front of the extension in the Extension text box, or the OK button remains unavailable. 7. When the OK button becomes active, click OK to continue. Source: http://support.microsoft.com/?id=317948 -paulwebmaster at a1alon dot de I?-(u!-?JJ: J@:<<

If you use IIS6 you have to add a new Webextension for PHP to work, otherwise you will get a "404"-Page if you try to point your browser to a "*.php" file. In order to do this you have to open the IIS-management console and open the "local computer". Under "webextensions" you will find allready a list with different extensions all being blocked by default. To get PHP to work you have to manually add a new webextension. I only have a german version of IIS in front of me so forgive me if i translate the buttons wrongly. Click on "New webextension". Enter any name you like for your new extension. Click on "Add..." and then on "Search...". If you would like to add the DLL just browse to your PHP-directory and you will find the php5ts.dll. If you search for the php-cgi.exe you have to change the filetype at the bottom to

"CGI-Exe-Files". Only after changing the filetype you can see the phpcgi.exe file and choose it for the extension. If you check the checkbox at the bottom of the "New extension" Window it will allow the newly added extension to be executed. Certainly you can change the status any time you want by clicking on "Allow". Only after that procedure you will be able to get in touch with PHP-files. sincerely Juergen Sommer
1enimus at mail dot com JN--un-?JJ: J@:<@

Under IIS6 (and earlier) After all the installation, do not forget to add "index.php" as default page, under the Documents tab in the Web Site's Properties. 1. Right-click Web Sites, choose Properties 2. Click Documents tab 3. Click Add... 4. Type index.php, click Ok 5. Choose "index.php" from the list and move it to the top using Move Up button. 6. Make sure "Enable default content page" is checked. Ofcourse you can add other pages as default. For those that do not know what is this for: If you do not provide full URL and you have several pages in the directory which are in this list, the server will return the topmost of them. In case you wish to open other page of them, you have to provide its full URL. Putting "index.php" on top will make sure no other pages will be returned as default.
>orrit at &amepart# dot net JI--un-?JJ: J::BB

If you experience extreme high loading times, please have a look at this http://bugs.php.net/bug.php?id=28524
tstirrat "T optusnet 5'T com 5T au ?J-(pr-?JJ: JA:I:

I am running Active Directory & IIS6.0 I found that after looking through the tutorial below i was still unable to get into my site (authentication popup, 401.3 error). I set my permissions for read & execute for IUSR_(server) and IIS_WPG for both my document root and the php directory.. no luck. However, here's how i solved the problem. (I believe this solution is relevant to fixing the active directory issue) 1. You want to give the IUSR_* and IIS_WPG read & execute permission to the PHP DIRECTORY ONLY. (I managed to remove the credentials from my document root and it still works. 2. Open IIS Manager and go to Application Pools, then to the pool which is relevant to your site (in my case DefaultAppPool).. on this item, right click and choose properties. 3. Now navigate to the identity tab. 4. My Worker process was set to Predefined: Network Service. I changed this to Configurable: IWAM_(server name) (which if you noticed is in the user group 'IIS_WPG') Note: i also changed the passwords for my IUSR_* and IWAM_* accounts to be sure they werent set to something easy by default. Its probably a good idea to do this too. Hope this solves someones frustration.
&iunta dot &aetano at sea!aeroportimilano dot it I?-9e"-?JJ: J<:B?

If some extensions (such as OCI or Turck mmcache in FastCGI mode) have trouble functioning with PHP+IIS, make sure that "Allow IIS to Control Password" is unchecked in the preferences panel for anonymous user access. For more detail on the issue, read articles 216828 and 218756 in the MS Knoweledge Base.
"aron Flew II-9e"-?JJ: I?:?:

Under IIS 6, don't forget that you have to add all the PHP modules you'd like to run to the PHP Web Service Extension part under the IIS management console.
webmaster at riachao dot com I?-(u!-?JJB JN::O

In the installation with IIS 6.0, after you add the isapi extension, you need to allow the extension in the Web Services Extensions, or you 'll get a 404 error.
nbroo;ins at cbwstores dot com IJ-(pr-?JJB JO:IN

On Windows Server 2003 (formerly .net server) with IIS 6 (final RTM - build 3790) I got PHP working by using one of the tips above (thanks!). I noted however, that I did not need to 'allow unknown Isapi applications' , and I was able to keep the configuration at 'Scripts Only' instead of 'Scripts and Executables' - both settings are potentially more secure this way. The only configuration that is different from how I normally configure PHP on IIS 5 is the addition of PHP as a Web Service Extension.
>do&&@@ at msn dot com JB-)ov-?JJ? JA:<J

Here's a quick fyi, to get PHP installed on .Net Server w/ IIS 6 you have to use the IIS manager to enable support for different web service extentions. CGI ,ASP, ISAPI are all prohibited by default. In IIS manager click on the Web Service Extentions Folder there's options to add a new extention , prohibit all extentions etc. I chose add new extention ,in the dialog box I named it PHP , click add , in the next dialog browse to path of 'php4isapi.dll' hit ok then mark checkbox "Set extention status Allowed" hit ok and all is good. This was done after I followed the install.txt for IIS 4 or newer .
&re& at wfrmls dot com ??--an-?JJI JO:I?

When using WindowsNT 4.0 and IIS, the WWW home directory needs to have Read AND Execute access rights.

"pache 1.0.

on 4icrosoft Windows

#his section contains notes and hints specific to (pache I&B&x installs of PHP on $icrosoft Windows systems& #here are also instructions and notes for (pache ? on a separate pa!e& *ote: Please read the manual installation steps firstF #here are two ways to set up PHP to wor* with (pache I&B&x on Windows& One is to use the +3. "inary (php.exe for PHP : and php-cgi.exe for PHP <)' the other is to use the (pache $odule 1%%& .n either case you need to edit your httpd.conf to confi!ure (pache to wor* with PHP' and then restart the server& .t is worth notin! here that now the (P. module has "een made more sta"le under Windows' we recommend it0s use a"ove the +3. "inary' since it is more transparent and secure& (lthou!h there can "e a few variations of confi!urin! PHP under (pache' these are simple enou!h to "e used "y the newcomer& Please consult the (pache 1ocumentation for further confi!uration directives& (fter chan!in! the confi!uration file' remem"er to restart the server' for example' *ET .T'P "P"CHE followed "y *ET .T"HT "P"CHE' if you run (pache as a Windows ervice' or use your re!ular shortcuts& *ote: 2emem"er that when addin! path values in the (pache confi!uration files on Windows' all "ac*slashes such as c:\directory\file.ext must "e converted to forward slashes' as c:/directory/file.ext& ( trailin! slash may also "e necessary for directories&

Installin& as an "pache module


/ou should add the followin! lines to your (pache httpd.conf file: E ample 6!0. PHP as an "pache 1.0. module

#his assumes PHP is installed to c:\php& (d,ust the path if this is not the case& 9or PHP ::

# Add to the end of the LoadModule section # Don't forget to copy this file from the sapi directory! LoadModule php4_module "C:/php/php4apache.dll" # Add to the end of the AddModule section AddModule mod_php4.c
9or PHP <:

# Add to the end of the LoadModule section LoadModule php5_module "C:/php/php5apache.dll" # Add to the end of the AddModule section AddModule mod_php5.c
9or "oth:

# Add this line inside the <IfModule mod_mime.c> conditional brace AddType application/x-httpd-php .php

# For syntax highlighted .phps files, also add AddType application/x-httpd-php-source .phps

Installin& as a C-I binar#


.f you unCipped the PHP pac*a!e to C:\php\ as descri"ed in the $anual .nstallation need to insert these lines to your (pache confi!uration file to set up the +3. "inary: E ample 6!2. PHP and "pache 1.0. as C-I teps section' you

ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php # For PHP 4 Action application/x-httpd-php "/php/php.exe" # For PHP 5 Action application/x-httpd-php "/php/php-cgi.exe" # specify the directory where php.ini is SetEnv PHPRC C:/php
)ote that the second line in the list a"ove can "e found in the actual versions of httpd.conf' "ut it is commented out& 2emem"er also to su"stitute the c:/php/ for your actual path to PHP& Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s& .f you would li*e to present PHP source files syntax hi!hli!hted' there is no such convenient option as with the module version of PHP& .f you chose to confi!ure (pache to use PHP as a +3. "inary' you will need to use the hi&hli&ht8file() function& #o do this simply create a PHP script file and add this code: $%php h'4hl'4ht_9'leQ,so3e_php_scr'pt.php,RK %&&

"pache 1.0. on 4icrosoft Windows FCarr ?J--an-?JJN JI:B<

add a note 7ser +ontri"uted )otes

To Besta and 'j dot b..dot sk': 'Add Module mod_php4.c' or 'AddModule mod_php5.c' may or may not be necessary depending on your environment and version of Apache. In my situation, this add module DID NOT work or it wasn't necessary. The LoadModule was enough to do the trick. I tried it with PHP4 on Apache 1.3.34 and Apache 2.0. All in all, your notes have been helpful.
> dot b at inmail dot s; ?@- ep-?JJ< I?::?

Thanks.

DO NOT FORGET to add "index.php" into <IfModule mod_dir.c> DirectoryIndex index.html </IfModule>

so you get index.php processed;multiple values separate by space: <IfModule mod_dir.c> DirectoryIndex index.html index.php </IfModule>
?@-(u!-?JJ< JI:<I

On contrary to user "Besta"'s post AddModule mod_php5.c should be added to the addmodule section. I installed php5 and apache 1.3.3 and without the above line it is not recognizing the .php files
Festa J@-(u!-?JJ< J?:IN

Do not add this line to apache http.conf. It does not work. AddModule mod_php5.c Also, remember to edit the system variables, edit the PATH and add the path to the php directory and restart windows.
ps#chosos at &m dot at ?@-9e"-?JJ< J<:<O

Please note that the SetEnv PHPRC "directory/to/phpini/" only works when using PHP as CGI, but _not_ when you use the PHP Apache Module!

"pache $.@.

on 4icrosoft Windows

#his section contains notes and hints specific to (pache ?&J&x installs of PHP on $icrosoft Windows systems& We also have instructions and notes for (pache I&B&x users on a separate pa!e& *ote: /ou should read the manual installation steps firstF *ote: 7sers of (pache ?&?&x may use the documentation "elow except the appropriate 1%% files are instead named php4apache2_2.dll and php5apache2_2.dll& #hese exist in the PHP distri"ution as of PHP <&?&J& ee also http:EEsnaps&php&netE Warnin& We do not recommend usin! a threaded $P$ in production with (pache?& 7se the prefor* $P$ instead' or use (pacheI& 9or information on why' read the related 9(= entry on usin! (pache? with a threaded $P$ /ou are hi!hly encoura!ed to ta*e a loo* at the (pache 1ocumentation to !et a "asic understandin! of the (pache ?&J&x erver& (lso consider to read the Windows specific notes for (pache ?&J&x "efore readin! on here& PHP and "pache $.@. compatibilit# notes: #he followin! versions of PHP are *nown to wor* with the most recent version of (pache ?&J&x:

PHP :&B&J or later availa"le at Edownloads&php&

the latest sta"le development version& 3et the source code http:EEsnaps&php&netEphp<latest&tar&!C or download "inaries for Windows http:EEsnaps&php&netEwinB?Ephp<-winB?-latest&Cip& a prerelease version downloada"le from http:EEDa&php&netE& you have always the option to o"tain PHP throu!h anonymous +> &

#hese versions of PHP are compati"le to (pache ?&J&:J and later& (pache ?&J ).-2-support started with PHP :&?&J& PHP :&?&B wor*s with (pache ?&J&BO' don0t use any other version of (pache with PHP :&?&B& However' the recommended setup is to use PHP :&B&J or later with the most recent version of (pache?& (ll mentioned versions of PHP will wor* still with (pache I&B&x& Warnin& (pache ?&J&x is desi!ned to run on Windows )# :&J' Windows ?JJJ or Windows 8P& (t this time' support for Windows Ox is incomplete& (pache ?&J&x is not expected to wor* on those platforms at this time& 1ownload the most recent version of (pache ?&J&x and a fittin! PHP version& 9ollow the $anual .nstallation teps and come "ac* to !o on with the inte!ration of PHP and (pache& #here are two ways to set up PHP to wor* with (pache ?&J&x on Windows& One is to use the +3. "inary the other is to use the (pache module 1%%& .n either case you need to edit your httpd.conf to confi!ure (pache to wor* with PHP and then restart the server& *ote: 2emem"er that when addin! path values in the (pache confi!uration files on Windows' all "ac*slashes such as c:\directory\file.ext must "e converted to forward slashes' as c:/directory/file.ext& ( trailin! slash may also "e necessary for directories&

Installin& as a C-I binar#


/ou need to insert these three lines to your (pache httpd.conf confi!uration file to set up the +3. "inary: E ample 6!3. PHP and "pache $.@ as C-I

ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php # For PHP 4 Action application/x-httpd-php "/php/php.exe" # For PHP 5 Action application/x-httpd-php "/php/php-cgi.exe"
Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s&

Installin& as an "pache module


/ou need to insert these two lines to your (pache httpd.conf confi!uration file to set up the PHP module for (pache ?&J: E ample 6!6. PHP and "pache $.@ as 4odule

# For PHP 4 do something like this: LoadModule php4_module "c:/php/php4apache2.dll" # Don't forget to copy the php4apache2.dll file from the sapi directory! AddType application/x-httpd-php .php # For PHP 5 do something like this: LoadModule php5_module "c:/php/php5apache2.dll" AddType application/x-httpd-php .php # configure the path to php.ini PHPIniDir "C:/php"
*ote: 2emem"er to su"stitute your actual path to PHP for the c:/php/ in the a"ove examples& #a*e care to use either php4apache2.dll or php5apache2.dll in your %oad$odule directive and ot php4apache.dll or php5apache.dll as the latter ones are desi!ned to run with (pache I&B&x& *ote: .f you want to use content ne!otiation' read related 9(=& Warnin& 1on0t mix up your installation with 1%% files from d'99ere t -H- ?ers'o s& /ou have the only choice to use the 1%%0s and extensions that ship with your downloaded PHP version&

"pache $.@. on 4icrosoft Windows el&a1 at &m dot de IJ--ul-?JJN J<:B@

add a note 7ser +ontri"uted )otes

"I had a hard time to install PHP5.1 with Apache2.2 as a module, because whenever I tried to start apache, I always got the error that "Cannot load C:/php/php5apache2.dll into server: The specified module could not be found." I nearly lost my nerves... Couldn't find any mistakes, than I`ve downloaded 'php5apache2.dll-php5.1.x.zip' from http://www.apachelounge.com/download and exchanged it, now it works... Thank you for the advise! It has helped me a lot. It works!!! :lol:

m 1 b d at htomail dot com IJ-$ay-?JJN JN:??

Indeed the references to "apachelounge" are a lifesaver! With regards to installation : Apache 2.2.2 and php v5.1.2 / 5.1.3 / 5.1.4 http://www.apachelounge.com/ Excellent site for these installation issues. MX
philip at php dot net J<-$ay-?JJN II:<@

If you use Apache 2.2.x, the included DLLs (php4apache2.dll and php5apache2.dll) will not work for you as they are specific to the Apache 2.0.x API. There is an open bug report to address this issue but if you can't wait then go to the following URL and download an appropriate DLL for Apache 2.2.x: * http://apachelounge.com/ The PHP Group does not endorse this site but it appears useful, so use it :-)
l#hAedu J:-$ay-?JJN JA:IB

I had a hard time to install PHP5.1 with Apache2.2 as a module, because whenever I tried to start apache, I always got the error that "Cannot load C:/php/php5apache2.dll into server: The specified module could not be found." I have checked that php5apache2.dll does in the right directory of "c:/php/", and I have also tried to copy some files (php5ts.dll, php.ini) into relevant directories, such as WINDOWS/, Apache2/, but none of them worked. I then found a post http://www.apachelounge.com/forum/ viewtopic.php?t=139&view=next&sid=b8df0fe80ac524939e2553ad7ee49123 and tried as suggested by downloading a zip file created by Steffen, and followed the instructions. The apache2.2 now works fine. BTW, I am using a XP home and folllowed the instructions on the top part of this page.
chris !dot! chaudruc !at! &mail !dot! co I<-1ec-?JJ< J@:J?

This took a while for me to figure out but hopefully it will save some time for others. Running Apache 2, PHP 5.1.1 on Windows XP and could not get mysql library to load. Extension path was correct in php.ini and the module resided in the correct spot. Discovered that libmysql.dll in the root php directory needs to be moved to C:\WINDOWS or be included in Windows paths in order for this module to load. From Zend: "Some modules depend of other libraries, like MySQL. In this case you need to copy libmysql.dll from your MySQL/bin installation directory to a directory in your PATH, like C:\WINDOWS" Copied over the file and mysql functionality was enabled.
I?-1ec-?JJ< JB:I?

There are often strong suggestions that Apache/MySQL/PHP should be set up in the Windows root folder, and dire warnings against using folders with spaces in the name. But as a relatively non-technical user, I hate cluttering my Windows XP root directory with folders that should be under Program Files,

and of keeping any documents other than in "My Documents" (even though I agree that MS's folder tree is ugly). Frankly I've never had any difficulty with Apache and MySQL under Program Files, PHP5 deep in the Apache tree, and all documents under My Docs.. Here are the related Apache 2 config lines I use in case anyone is interested (sorry if there are broken lines): ServerRoot "C:/Program Files/Apache Group/Apache2" DocumentRoot "C:/Documents and settings/UserNm/My Documents/Websites" # PHP 5 module LoadModule php5_module "c:/Program Files/Apache Group/Apache2/php5/php5apache2.dll" AddType application/x-httpd-php .php PHPIniDir "C:/Program Files/Apache Group/Apache2/php5/"
msonsu= at e ample dot com I:-Oct-?JJ< JN:?A

When you try apache using the bin directory use the command: apache -n "service_name" -t Use for service_name the name u used. You can find the service_name also in the system tray
withheld at withheld dot com JN-(u!-?JJ< JN::J

BTW I use Win9x to develop but it's not a production server. And yes, adding a trailing slash to the PHPIniDir directive helps.
Isaac dot Frown at "r1in4eritor dot com I@-$ay-?JJ< J<:<O

Some XP finding php.ini finding

machines are having troubles with the PHPIniDir derective not the php.ini (or so they think). Directories that do contain a file are returned as empty and it defaults to the next method of php.ini (often C:/windows or C:/winnt).

This is likely caused by read permissions not being set correctly on NTFS file systems, however, it has occurred when no cause could be identified. If setting correct file permissions doesn't work, the easiest way around this problem is moving php.ini to the Apache directory or adding the HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath string to your registry and setting it to the correct directory.
wrowe at apache dot or& II-(pr-?JJ< J<:?N

Although the warning above reads "We do not recommend using a threaded MPM in production with Apache2" - ignore that nonsense for Win32. All Apache/Win32 builds were *always* threaded. Always choose Apache 2 over Apache 1.3 on Windows - because major portions of Apache 2 were written from the ground up to accept Windows. Apache 1.3 was never designed for threads or non-posix systems. For Windows they were squirled in with some rather ugly hacks, which will never enjoy much improvement.

.unC iPlanet and *etscape ser1ers on 4icrosoft Windows


#his section contains notes and hints specific to un -ava iPlanet and )etscape server installs of PHP on Windows& ystem We" erver' un O); We" erver'

9rom PHP :&B&B on you can use PHP scripts with the ) (P. module to !enerate custom directory listin!s and error pa!es& (dditional functions for (pache compati"ility are also availa"le& 9or support in current we"servers read the note a"out su"reDuests&

C-I setup on .unC iPlanet and *etscape ser1ers


#o install PHP as a +3. handler' do the followin!:

+opy

php4ts.dll to your systemroot (the directory where you installed Windows)

$a*e a file association from the command line& #ype the followin! two lines:

assoc .php=PHPScript ftype PHPScript=c:\php\php.exe %1 %*

.n the )etscape ;nterprise (dministration erver create a dummy shellc!i directory and remove it ,ust after (this step creates < important lines in o",&conf and allow the we" server to handle shellc!i scripts)& .n the )etscape ;nterprise (dministration internalEshellc!i' 9ile uffix:php)& erver create a new mime type (+ate!ory: type' +ontent-#ype: ma!nus-

1o it for each we" server instance you want PHP to run

$ore details a"out settin! up PHP as a +3. executa"le can "e found here: http:EE"enoit&noss&free&frEphpEinstall-php&html

*."PI setup on .unC iPlanet and *etscape ser1ers


#o install PHP with ) (P.' do the followin!:

+opy

php4ts.dll to your systemroot (the directory where you installed Windows)

$a*e a file association from the command line& #ype the followin! two lines:

assoc .php=PHPScript ftype PHPScript=c:\php\php.exe %1 %*

.n the )etscape ;nterprise (dministration internalEx-httpd-php' 9ile uffix: php)&

erver create a new mime type (+ate!ory: type' +ontent-#ype: ma!nus-

;dit magnus.conf (for servers TQ N) or the lines after 3'3e tApes ' 't&

obj.conf (for servers U N) and add the followin!: /ou should place

Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="c:/php/sapi/php4nsapi.dll" Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_ini="c:/path/to/php.ini"]

(PHP TQ :&B&B) #he php_' ' parameter is optional "ut with it you can place your directory& +onfi!ure the default o",ect in and "efore all 0(dd%o!0 lines:

php.ini in your we"server confi!

obj.conf (for virtual server classes R un We" erver N&JVS in their vserver.obj.conf): .n the $O!Sect a3e;Ede9a#ltE& section' place this line necessarily after all 0O",ect#ype0 Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inikey=value ...]

(PHP TQ :&B&B) (s additional parameters you can add some special php.ini-values' for example you can set a docroot;E/path/to/docrootE specific to the context php<_e"ec#te is called& 9or "oolean ini-*eys please use JEI as value' not EO EFEO99EF... (this will not wor* correctly)' e&!& Gl'!.o#tp#t_co3press'o ;1 instead of Gl'!.o#tp#t_co3press'o ;EO E #his is only needed if you want to confi!ure a directory that only consists of PHP scripts (same li*e a c!i-"in directory):

<Object name="x-httpd-php"> ObjectType fn="force-type" type="magnus-internal/x-httpd-php" Service fn=php4_execute [inikey=value inikey=value ...] </Object>

(fter that you can confi!ure a directory in the (dministration server and assi!n it the style "=httpd=php& (ll files in it will !et executed as PHP& #his is nice to hide PHP usa!e "y renamin! files to .html& 2estart your we" service and apply chan!es 1o it for each we" server instance you want PHP to run

*ote: $ore details a"out settin! up PHP as an ) (P. filter can "e found here: http:EE"enoit&noss&free&frEphpEinstall-php:&html *ote: #he stac*siCe that PHP uses depends on the confi!uration of the we"server& .f you !et crashes with very lar!e PHP scripts' it is recommended to raise it with the (dmin erver (in the section "$(3)7 ;1.#O2")&

C-I en1ironment and recommended modifications in php.ini


.mportant when writin! PHP scripts is the fact that un - W E un O); W EiPlanetE)etscape is a multithreaded we" server& 4ecause of that all reDuests are runnin! in the same process space (the space of the we"server itself) and this space has only one environment& .f you want to !et +3. varia"les li*e -.TH_2N6O' HTT-_HO)T etc& it is not the correct way to try this in the old PHP B&x way with &eten1() or a similar way (re!ister !lo"als to environment' (_EN*)& /ou would only !et the environment of the runnin! we"server without any valid +3. varia"lesF *ote: Why are there (invalid) +3. varia"les in the environment? (nswer: #his is "ecause you started the we"server process from the admin server which runs the startup script of the we"server' you wanted to start' as a +3. script (a +3. script inside of the admin serverF)& #his is why the environment of the started we"server has some +3. environment varia"les in it& /ou can test this "y startin! the we"server not from the administration server& 7se the command line as root user and start it manually you will see there are no +3.-li*e environment varia"les& imply chan!e your scripts to !et +3. varia"les in the correct way for PHP :&x "y usin! the super!lo"al (_)ER*ER& .f you have older scripts which use (HTT-_HO)T' etc&' you should turn on re4'ster_4lo!als in php.ini and chan!e the varia"le order too (important: remove EEE from it' "ecause you do not need the environment here):

variables_order = "GPCS" register_globals = On

.pecial use for error pa&es or self!made director# listin&s (PHP DE 2.0.0)
/ou can use PHP to !enerate the error pa!es for E<0< Not 6o# dE or similar& (dd the followin! line to the o",ect in obj.conf for every error pa!e you want to overwrite:

Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inikey=value...]


where HHH is the H##P error code& Please delete any other Error directives which could interfere with yours& .f you want to place a pa!e for all errors that could exist' leave the code parameter out& /our script can !et the H##P status code with (_)ER*ER+,ERROR_TD-E,0&

(nother possi"ility is to !enerate self-made directory listin!s& -ust create a PHP script which displays a directory listin! and replace the correspondin! default ervice line for tApe;E3a4 #s=' ter al/d'rectorAE in obj.conf with the followin!:

Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=value inikey=value...]


9or "oth error and directory listin! pa!es the ori!inal 72. and translated 72. are in the varia"les (_)ER*ER+,-.TH_2N6O,0 and (_)ER*ER+,-.TH_TR.N)7.TED,0&

*ote about nsapi81irtual() and subre9uests (PHP DE 2.0.0)


#he ) (P. module now supports the nsapi81irtual() function (alias: 1irtual()) to ma*e su"reDuests on the we"server and insert the result in the we"pa!e& #he pro"lem is' that this function uses some undocumented features from the ) (P. li"rary& 7nder 7nix this is not a pro"lem' "ecause the module automatically loo*s for the needed functions and uses them if availa"le& .f not' nsapi81irtual() is disa"led& 7nder Windows limitations in the 1%% handlin! need the use of a automatic detection of the most recent ns-httpdXX.dll file& #his is tested for servers till version N&I& .f a newer version of the un server is used' the detection fails and nsapi81irtual() is disa"led& .f this is the case' try the followin!: (dd the followin! parameter to php<_' 't in magnus.confEobj.conf:

Init fn=php4_init ... server_lib="ns-httpdXX.dll"


where HH is the correct 1%% version num"er& #o !et it' loo* in the server-root for the correct 1%% name& #he 1%% with the "i!!est filesiCe is the ri!ht one& /ou can chec* the status "y usin! the phpinfo() function& *ote: 4ut "e warned: upport for nsapi81irtual() is ;8P;2.$;)#(%FFF

'mniHTTPd .er1er
#his section contains notes and hints specific to OmniH##Pd on Windows& *ote: /ou should read the manual installation steps firstF Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s& /ou need to complete the followin! steps to ma*e PHP wor* with OmniH##Pd& #his is a +3. executa"le setup& (P. is supported "y OmniH##Pd' "ut some tests have shown that it is not so sta"le to use PHP as an . (P. module& Important for C-I users: 2ead the faD on c!i&forceHredirect for important details& #his directive needs to "e set to 0& I& .nstall OmniH##Pd server& 2i!ht clic* on the "lue OmniH##Pd icon in the system tray and select -ropert'es +lic* on We! )er?er /lo!al )ett' 4s On the 0;xternal0 ta"' enter: ?'rt#al ; .php T act#al ; c:NphpNphp.e"e (use php-cgi.exe if installin! PHP <)' and use the (dd "utton& On the M'3e ta"' enter: ?'rt#al ; :::ser?er/stdc4' T act#al ; .php' and use the (dd "utton& +lic* O5

?& B& :& <& N&

2epeat steps ? - N for each extension you want to associate with PHP& *ote: ome OmniH##Pd pac*a!es come with "uilt in PHP support& /ou can choose at setup time to do a custom setup' and unchec* the PHP component& We recommend you to use the latest PHP "inaries& ome OmniH##Pd servers come with PHP : "eta distri"utions' so you should choose not to set up the "uilt in support' "ut install your own& .f the server is already on your machine' use the 2eplace "utton in tep : and < to set the new' correct information&

.ambar .er1er on 4icrosoft Windows


#his section contains notes and hints specific to the am"ar erver for Windows&

*ote: /ou should read the manual installation steps firstF #his list descri"es how to set up the . (P. module to wor* with the am"ar server on Windows&
am"ar install directory&

9ind the file called Open

mappings.ini (in the confi! directory) in the mappings.ini and add the followin! line under +2).-20:

E ample 6!7. I."PI confi&uration of .ambar

#for PHP 4 *.php = c:\php\php4isapi.dll #for PHP 5 *.php = c:\php\php5isapi.dll

(#his line assumes that PHP was installed in )ow restart the

c:\php&)

am"ar server for the chan!es to ta*e effect&

Gitami on 4icrosoft Windows


#his section contains notes and hints specific to 8itami on Windows& *ote: /ou should read the manual installation steps firstF #his list descri"es how to set up the PHP +3. "inary to wor* with 8itami on Windows& Important for C-I users: 2ead the faD on c!i&forceHredirect for important details& #his directive needs to "e set to 0& .f you want to use (_)ER*ER+,-H-_)E76,0 you have to ena"le the c!i&fixHpathinfo directive& Warnin& 4y usin! the +3. setup' your server is open to several possi"le attac*s& Please read our +3. security section to learn how to defend yourself from those attac*s&

$a*e sure the we"server is runnin!' and point your "rowser to xitamis admin console (usually http://127.0.0.1/ad3' )' and clic* on +onfi!uration& )avi!ate to the 9ilters' and put the extension which PHP should parse (i&e& &php) into the field 9ile extensions (&xxx)& .n 9ilter command or script put the path and name of your PHP +3. executa"le i&e& or

C:\php\php.exe for PHP :'

C:\php\php-cgi.exe for PHP <&

Press the 0 ave0 icon& 2estart the server to reflect chan!es&

Gitami on 4icrosoft Windows ae8en&ine at #ahoo dot com J?-)ov-?JJ: JN:J@

add a note 7ser +ontri"uted )otes

I have successfully configured Xitami using cgi.redirect in PHP set cgi.redirect = 1 set cgi.redirect_status = CGI_REDIRECT_STATUS; in Xitami, defaults.cfg under CGI_ENVIRONMENT insert CGI_REDIRECT_STATUS="-"
r>b1 at catalo& dot net dot au IA- ep-?JJ: J@:?B

I am running xitami as a business www server on ms-windows. I have a number of long-running PHP scripts. I developed a tiny java applet to receive and display progressive status information from these slow scripts. It effectively facilitates SERVER PUSH from PHP scripts to IE and Netscape browsers. Take a look: catalog.net.au/netClient.zip (Ron Boles, Melbourne, Australia)
r>b1 at catalo& dot net dot au I?-(pr-?JJ: J<:<@

PHP via ISAPI with XITAMI I have developed a small GUI in c++, which runs XITAMI and configures the Xitami ISAPI interface for use with PHP. It is so much faster than the PHP cgi interface and appears to be more stable too. Take a look here: http://catalog.net.au/xisapi/default.html Ron Boles Melbourne, Australia
Hoshambo IN-Oct-?JJB JI:BO

I was only able to get PHP (4.3.3) working under Xitami (2.5c0) on Windows XP (SP1) by adding the following lines to defaults.cfg: [Mime] php=application/x-httpd-php

[Filter] .php="c:/php/php.exe" Note the quotation marks and the forward slashes in the filter section.
da1id at ad1isor#matters dot co dot u; I?- ep-?JJB J::<:

Using the CGI (c:\php[version]\php.exe) with Xitami since PHP version 4.3.2 requires the following setting in php.ini before the $_SERVER['PHP_SELF'] call will return a value: cgi.fix_pathinfo=1 Note that $_SERVER['SCRIPT_NAME'] still works.
>an;o dot sla1ic at email dot si BJ-)ov-?JJ? J?:<I

[Editors Note] You can force IE to disregard a cached page by pressing the Control key and click the Refresh button. Please, do not forget the IE caches files. I had a test.php and got the error message. I changed the defaults.cfg and also the cgi.force_redirect to = 0. After restarting the Xitami the error message was still there. After a while I saved the test.php file to test2.php and found that it is working fine...

Fuildin& from source


#his chapter teaches how to compile PHP from sources on windows' usin! $icrosoft0s tools& #o compile PHP with cy!win' please refer to +hapter :&

He9uirements
#o compile and "uild PHP you need a $icrosoft 1evelopment ;nvironment& $icrosoft >isual +VV N&J is recommended' thou!h >isual +VV &);# versions will also wor*& ince PHP < the free $icrosoft &);# toolchain is also supported (you need to install Windows Platform 16' >isual +VV #ool*it and &);# 9ramewor* 16)& #o extract the downloaded files you will also need a P.P extraction utility& Windows 8P and newer already include this functionality "uilt-in& 4efore you !et started' you have to download:

the winB? "uildtools from the PHP site at EextraEwinB?"uild&Cip& the source code for the 1) name resolver used "y PHP from EextraE"indli"HwB?&Cip& #his is a replacement for the resolv.lib li"rary included in win32build.zip& .f you plan to compile PHP as a (pache module you will also need the (pache sources&

9inally' you are !oin! to need the source to PHP itself& /ou can !et the latest development version usin! anonymous +> ' a snapshot or the most recent released source tar"all&

Puttin& it all to&ether


(fter downloadin! the reDuired pac*a!es you have to extract them in a proper place:

+reate a wor*in! directory where all files end up after extractin!' e&!: +reate the directory into it& +reate the directory

C:\work& win32build under your wor*in! directory (C:\work) and unCip win32build.zip

bindlib_w32 under your wor*in! directory (C:\work) and unCip bindlib_w32.zip into it& ;xtract the downloaded PHP source code into your wor*in! directory (C:\work)&
4uild the li"raries you are !oin! to need (or download the "inaries if availa"le) and place the headers and li"s in the C:\work\win32build\include and C:\work\win32build\lib directories' respectively& .f you don0t have cy!win installed with "ison and flex' you also need to ma*e the C:\work\win32build\bin directory availa"le in the P(#H' so that thoses tools can "e found "y the confi!ure script&

9ollowin! this steps your directory structure loo*s li*e this:

+--C:\work | | | +--bindlib_w32 | | | | | +--arpa | | | | | +--conf | | | | | +--... | | | +--php-5.x.x | | | | | +--build | | | | | +--... | | |

| | | | | | | | | | |

| +--win32 | | | +--... | +--win32build | | | +--bin | | | +--include | | | +--lib

.f you aren0t usin! +y!win' you must also create the directories C:\usr\local\lib and then copy bison.simple from C:\work\win32build\bin to C:\usr\local\lib& *ote: .f you want to use P;(2 and the comforta"le command line installer' the +%.- (P. is mandatory& 9or more information a"out P;(2 and the installer read the documentation at the P;(2 we"site&

Fuild resol1.lib
/ou must "uild the resolv.lib li"rary& 1ecide whether you want to have de"u! sym"ols availa"le ("indli" - WinB? 1e"u!) or not ("indli" - WinB? 2elease)' "ut please remem"er the choice you made' "ecause the de"u! "uild will only lin* with PHP when it is also "uilt in de"u! mode& 4uild the appropriate confi!uration:

9or 37. users' launch >+VV' "y dou"le-clic*in! in 4uildQT2e"uild (ll&

C:\work\bindlib_w32\bindlib.dsw& #hen select

9or command line users' ma*e sure that you either have the +VV environment varia"les re!istered' or have run 1c1ars.bat' and then execute one of the followin! commands:

o o

msde1 bindlib.dsp /4"OE Qbindlib ! Win0$ 5ebu&Q msde1 bindlib.dsp /4"OE Qbindlib ! Win0$ HeleaseQ

(t this point' you should have a usa"le resolv.lib in either your C:\work\bindlib_w32\Debug or Release su"directories& +opy this file into your C:\work\win32build\lib directory over the file "y the same name found in there&

Fuildin& PHP usin& the new build s#stem JPHP DE3 onl#K
#his chapter explains how to compile PHP TQ< usin! the new "uild system' which is +%.-"ased and very similar with the main PHP0s 7nix "uild system& *ote: #his "uild system isn0t availa"le in PHP :& Please refer to the C#'ld' 4 -H- #s' 4 D)W 9'les +-H- <0 instead& ection called

4efore startin!' "e sure you have read the ection called -#tt' 4 't all to4ether and you have "uilt all needed li"raries' li*e %i"xml or .+7 (needed for PHP TQ N)& 9irst you should open a >isual tudio +ommand Prompt' which should "e availa"le under the tart menu& ( re!ular +ommand Prompt window shouldn0t wor*' as pro"a"ly it doesn0t have the necessary environment varia"les set& #hen type somethin! li*e cd C:Rwor;Rphp!3. . to enter in the PHP source dir& )ow you are ready to start confi!urin! PHP& #he second step is runnin! the buildconf "atch file to ma*e the confi!ure script' "y scannin! the folder for config.w32 files& 4y default this command will also search in the followin! directories: pecl; ..\pecl; pecl\rpc; ..\pecl\rpc& ince PHP <&I&J' you can chan!e this "ehaviour "y usin! the ==add=3od#les=d'r ar!ument (e&!& cscript /nolo&o win0$/build/buildconf.>s !!add!modules! dirE../php!&t;$ !!add!modules!dirE../pecl)& #he third step is confi!urin!& #o view the list of the availa"le confi!uration options type cscript /nolo&o confi&ure.>s !!help& (fter choosin! the options that you will ena"leEdisa"le' type somethin! li*e: cscript

/nolo&o confi&ure.>s !!disable!foo !!enable!fun!e t& 7sin! ==e a!le=9oo;shared will attempt to "uild the 0foo0 extension as a shared' dynamically loada"le module& #he last step is compilin!& #o achieve this ,ust issue the command nma;e& #he !enerated files (e&!& &exe and &dll) will "e placed in either Release_TS or Debug_TS directories (if "uilt with #hread safety)' or in the Release or Debug directories otherwise& Optionally you may also run PHP0s test suite' "y typin! nma;e test& .f you want to run ,ust a specific test' you may use the 0#; # 0 varia"le (e&!& nma;e /5 TE.T.Ee t/s9lite/tests test - will only run sDlite0s tests)& #o delete the files that were created durin! the compilation' you can use the nma;e clean command& ( very useful confi!ure option to "uild snapshots is ==e a!le=s apshot=!#'ld' which add a new compilin! mode (nma;e build!snap)& #his tries to "uild every extension availa"le (as shared' "y default)' "ut it will i!nore "uild errors in individual extensions or (P.&

Fuildin& PHP usin& 5.W files JPHP 2K


+ompilin! PHP usin! the 1 W files isn0t supported as of PHP <' as a much more flexi"le system was made availa"le& (nyway' you can still use them' "ut *eep in mind that they are not maintained very often' so you can have compilin! pro"lems& #o compile PHP : for windows' this is the only availa"le way thou!h&

Confi&ure 4<C PP
#he first step is to confi!ure $>+VV to prepare for compilin!& %aunch $icrosoft >isual +VV' and from the menu select #ools QT Options& .n the dialo!' select the directories ta"& eDuentially chan!e the dropdown to ;xecuta"les' .ncludes' and %i"rary files& /our entries should loo* li*e this:

;xecuta"le files:

C:\work\win32build\bin' +y!win users: C:\cygwin\bin .nclude files: C:\work\win32build\include %i"rary files: C:\work\win32build\lib

Compilin&
#he "est way to !et started is to "uild the +3. version:

9or 37. users' launch >+VV' and then select 9ile QT Open Wor*space and select

C:\work\php-

4.x.x\win32\php4ts.dsw& #hen select 4uildQT

et (ctive +onfi!uration and select the desired confi!uration' either php<ts = W' O2 De!#4_T) or php<ts = W' O2 Release_T)& 9inally select 4uildQT2e"uild (ll& 9or command line users' ma*e sure that you either have the +VV environment varia"les re!istered' or have run 1c1ars.bat' and then execute one of the followin! commands from the C:\work\php-4.x.x\win32 directory:

o o o

msde1 php2ts.dsp /4"OE Qphp2ts ! Win0$ 5ebu&8T.Q msde1 php2ts.dsp /4"OE Qphp2ts ! Win0$ Helease8T.Q (t this point' you should have a usa"le

php.exe in either your C:\work\php-4.x.x\Debug_TS or

Release_TS su"directories&
.t is possi"le to do minor customiCation to the "uild process "y editin! the main/config.win32.h file& 9or example you can chan!e the default location of php.ini' the "uilt-in extensions' and the default location for your extensions& )ext you may want to "uild the +%. version which is desi!ned to use PHP from the command line& #he steps are the same as for "uildin! the +3. version' except you have to select the php<ts_cl' = W' O2 De!#4_T) or php<ts_cl' = W' O2 Release_T) pro,ect file& (fter a successful compilin! run you will find the php.exe in either the directory Release_TS\cli\ or Debug_TS\cli\& .n order to "uild the (P. module (php4isapi.dll) for inte!ratin! PHP with $icrosoft .. ' set your active confi!uration to php4isapi-whatever-config and "uild the desired dll&

Installation of e tensions on Windows


(fter installin! PHP and a we"server on Windows' you will pro"a"ly want to install some extensions for added functionality& /ou can choose which extensions you would li*e to load when PHP starts "y modifyin! your php.ini& /ou can also load a module dynamically in your script usin! dl()& #he 1%%s for PHP extensions are prefixed with php_& $any extensions are !#'lt ' to the Windows version of PHP& #his means additional 1%% files' and the extension directive' are ot used to load these extensions& #he Windows PHP ;xtensions ta"le lists extensions that reDuire' or used to reDuire' additional PHP 1%% files& Here0s a list of "uilt in extensions: .n PHP : (updated PHP :&B&II): 4+$ath' +aledar' +O$' +type' 9#P' $y =%' O14+' Overload' P+2;' ession' #o*eniCer' W118' 8$% and Pli" .n PHP < (updated PHP <&J&:)' the followin! chan!es exist& 4uilt in: 1O$' %i"8$%' .conv' and =%ite& (nd the followin! are no lon!er "uilt in: $y =% and Overload& imple8$%' P%

#he default location PHP searches for extensions is C:\php4\extensions in PHP : and C:\php5 in PHP <& #o chan!e this settin! to reflect your setup of PHP edit your php.ini file:

/ou will need to chan!e the extensionHdir settin! to point to the directory where your extensions lives' or where you have placed your php_*.dll files& 9or example:

extension_dir = C:\php\extensions
;na"le the extension(s) in

php.ini you want to use "y uncommentin! the e"te s'o ;php_1.dll lines in php.ini& #his is done "y deletin! the leadin! M from the extension you want to load&
E ample 6!L. Enable F=ip$ e tension for PHP!Windows

// change the following line from ... ;extension=php_bz2.dll // ... to extension=php_bz2.dll

ome of the extensions need extra 1%%s to wor*& +ouple of them can "e found in the distri"ution pac*a!e' in the

C:\php\dlls\ folder in PHP : or in the main folder in PHP <' "ut some' for example Oracle (php_oci8.dll) reDuire 1%%s which are not "undled with the distri"ution pac*a!e& .f you are installin! PHP :' copy the "undled 1%%s from C:\php\dlls folder to the main C:\php folder& 1on0t for!et to include C:\php
in the system -.TH (this process is explained in a separate 9(= entry)&

ome of these 1%%s are not "undled with the PHP distri"ution& ee each extensions documentation pa!e for details& (lso' read the manual section titled .nstallation of P;+% extensions for details on P;+%& (n increasin!ly lar!e num"er of PHP extensions are found in P;+%' and these extensions reDuire a separate download&

*ote: .f you are runnin! a server module version of PHP remem"er to restart your we"server to reflect your chan!es to php.ini& #he followin! ta"le descri"es some of the extensions availa"le and reDuired additional dlls& Table 6!1. PHP E tensions E tension phpH"C?&dll phpHcalendar&dll phpHcpdf&dll phpHcrac*&dll 5escription "Cip? compression functions +alendar conversion functions +li"P19 functions +rac* functions )one 4uilt in since PHP :&J&B )one )one *otes

E tension phpHctype&dll phpHcurl&dll phpHcy"ercash&dll phpHd"&dll phpHd"a&dll phpHd"ase&dll phpHd"x&dll phpHdomxml&dll phpHdotnet&dll phpHexif&dll phpHf"sDl&dll phpHfdf&dll phpHfilepro&dll phpHftp&dll phpH!d&dll phpH!d?&dll phpH!ettext&dll phpHhyperwave&dll phpHiconv&dll phpHifx&dll phpHiisfunc&dll phpHimap&dll phpHin!res&dll phpHinter"ase&dll phpH,ava&dll phpHldap&dll phpHm"strin!&dll phpHmcrypt&dll phpHmhash&dll phpHmin!&dll phpHmsDl&dll phpHmssDl&dll phpHmysDl&dll phpHmysDli&dll phpHociA&dll

5escription ctype family functions +72%' +lient 72% li"rary functions +y"ercash payment functions 14$ functions 14(: 1ata4ase (d"mstyle) ("straction layer functions d4ase functions d"x functions 1O$ 8$% functions &);# functions ;8.9 functions 9ront4ase functions 919: 9orms 1ata 9ormat functions& filePro functions 9#P functions 31 li"rary ima!e functions 31 li"rary ima!e functions 3ettext functions HyperWave functions .+O)> characterset conversion .nformix functions .. .$(P POPB and ))#P functions .n!res .. functions .nter4ase functions -ava functions %1(P functions $ulti-4yte functions trin! 4uilt in since PHP :&B&J

*otes

2eDuires: libeay32.dll' ssleay32.dll ("undled) PHP UQ :&?&J 1eprecated& 7se 14( instead (php_dba.dll) )one )one PHP UQ :&?&J reDuires: libxml2.dll ("undled) PHP TQ :&B&J reDuires: iconv.dll ("undled) PHP UQ :&I&I phpHm"strin!&dll& (nd' php_exif.dll must "e loaded a9ter php_mbstring.dll in php.ini& PHP UQ :&?&J 2eDuires: fdftk.dll ("undled) 2ead-only access 4uilt-in since PHP :&J&B 2emoved in PHP :&B&?& (lso note that truecolor functions are not availa"le in 31I' instead' use php_gd2.dll& 31? PHP UQ :&?&J reDuires gnu_gettext.dll ("undled)' PHP TQ :&?&B reDuires libintl-1.dll' iconv.dll ("undled)& )one 2eDuires: iconv-1.3.dll ("undled)' PHP TQ:&?&I

iconv.dll
2eDuires: .nformix li"raries

mana!ement functions )one )one 2eDuires: .n!res .. li"raries 2eDuires: gds32.dll ("undled) PHP UQ :&J&N reDuires: jvm.dll ("undled) PHP UQ :&?&J reDuires libsasl.dll ("undled)' PHP TQ :&B&J reDuires libeay32.dll' ssleay32.dll ("undled) )one 2eDuires: libmcrypt.dll PHP TQ :&B&J reDuires: libmhash.dll ("undled) 2eDuires: magic.mime ("undled) )one 2eDuires: msql.dll ("undled) 2eDuires: ntwdblib.dll ("undled) PHP TQ <&J&J' reDuires libmysql.dll ("undled) PHP TQ <&J&J' reDuires libmysql.dll (libmysqli.dll in PHP UQ <&J&?) ("undled) 2eDuires: Oracle A&IV client li"raries

$crypt ;ncryption functions $hash functions $in! functions for 9lash m =% functions $ =% functions $y =% functions $y =%i functions Oracle A functions

phpHmimeHma!ic&dll $imetype functions

E tension phpHopenssl&dll phpHoracle&dll phpHoverload&dll phpHpdf&dll phpHp!sDl&dll phpHprinter&dll phpHshmop&dll phpHsnmp&dll phpHsoap&dll phpHsoc*ets&dll phpHsy"aseHct&dll phpHtidy&dll phpHto*eniCer&dll phpHwB?api&dll phpHxmlrpc&dll phpHxslt&dll phpHyaC&dll phpHCip&dll phpHCli"&dll Open

5escription % functions Oracle functions O",ect overloadin! functions P19 functions Post!re =% functions Printer functions )$P !et and wal* functions O(P functions oc*et functions y"ase functions #idy functions #o*eniCer functions WB?api functions 8$%-2P+ functions 8 %# functions /(P functions Pip 9ile functions P%i" compression functions

*otes 2eDuires: libeay32.dll ("undled) 2eDuires: Oracle @ client li"raries 4uilt in since PHP :&B&J )one )one )one

hared $emory functions )one )# onlyF PHP TQ <&J&J )one 2eDuires: y"ase client li"raries PHP TQ <&J&J 4uilt in since PHP :&B&J )one PHP TQ :&?&I reDuires: iconv.dll ("undled) PHP UQ :&?&J reDuires sablot.dll' expat.dll ("undled)& PHP TQ :&?&I reDuires sablot.dll' expat.dll' iconv.dll ("undled)& 2eDuires: yaz.dll ("undled) 2ead only access 4uilt in since PHP :&B&J

Installation of e tensions on Windows he1esir at t!mobile dot hu J@-(pr-?JJN JI:<:

add a note 7ser +ontri"uted )otes

If You try to install PHP5 to IIS6 with Oracle.... Then You need some kind of pilot-exams, not for big planes, just a little one. So: After installations (php.ini is correct see above ie.: extenstion = php_oci8.dll etc) If You use anonymous access, You'll have a builtin user to use it. Make this user local administrator, or give minimum read access to PHP folder (ie.: c:\php) and ORAHOME (ie. c:\ora92) folders. If You use Windows Integrated authentication, give for Domain Users minimum read access to PHP folder (ie.: c:\php) and ORAHOME (ie. c:\ora92) folders. Goog luck.
sopp8ladios at hotmail dot com IO-(u!-?JJ: JO:B<

[editor note: this should be fixed in PHP 5.1.0] The order of the extensions listed in php.ini is causing problems... one must check that a particular extension A is enabled and above extension B if B requires A to be enabled. The original ordering doesnt make sure that this always happens (ie, A is above B) I came into this problem when I tried to enable the exif extension under windows. I knew mbstring is required but I kept getting errors even after I enabled both.

The problem can only be fixed by moving the mbstring line above the exif line...

You might also like