+ All Categories
Home > Documents > 133344830 Php Pentru Incepatori

133344830 Php Pentru Incepatori

Date post: 04-Jun-2018
Category:
Upload: andrushee
View: 253 times
Download: 2 times
Share this document with a friend

of 77

Transcript
  • 8/14/2019 133344830 Php Pentru Incepatori

    1/77

    Pentru nceput

    Introducere

    Cuprins

    Ce este PHP? Ce poate face PHP?

    Ce este PHP?PHP (acronim recursiv pentruPHP: Hypertext Preprocessor) este un limbaj de scripting de uzgeneral, cu cod-surs deschis (open source), utilizat pe scar larg, i care este potrivit !n specialpentru dezvoltarea aplica"iilor #eb i poate fi integrat !n H$%&'

    rumos, dar totui ce !nseamn aceasta? n e*emplu+

    Example #1 Un exemplu introductiv

  • 8/14/2019 133344830 Php Pentru Incepatori

    2/77

    facilit"ilor PHP' Pute"i s v implica"i !n scurt timp i s !ncepe"i a scrie scripturi simple pestec0teva ore'

    Cu toate c dezvoltarea PHP e a*at pe scripting de partea server-ului, pute"i s realiza"i mult maimulte cu el' Citi"i !n continuare i afla"i mai multe detalii !n sec"iunea !ntitulat Ce poate face PHP?,sau trece"i direct la ghidul de utilizare introductiv dac sunte"i interesat doar de programarea #eb'

    Ce poate face PHP?3rice' PHP este a*at !n principal pe scripting de partea server-ului, deci pute"i realiza cu el oricepoate realiza un alt program C45, cum ar fi colectarea datelor din forme, generarea con"inutuluidinamic al paginilor sau trimiterea i primirea coo6ies' 2ar PHP poate face mult mai multe'

    .unt trei domenii principale, unde scripturile PHP sunt utilizate'

    .cripting de partea serverului' 7cesta este cel mai tradi"ional i de baz domeniu al PHP'7ve"i nevoie de trei lucruri pentru ca aceasta s func"ioneze' 7nalizatorul PHP (!n calitate deC45, sau modul pentru server), un server #eb i un navigator #eb' $rebuie s rula"i serverul#eb cu o instalare PHP conectat la el' Pute"i accesa ieirile programului PHP cu navigatorul#eb, vizualiz0nd pagina PHP prin server' $oate acestea pot rula pe computeruldumneavoastr de acas, dac doar e*perimenta"i cu programarea !n PHP' Citi"i sec"iunea cuinstruc"iuni de instalarepentru informa"ii suplimentare'

    .cripting !n linia de comand' Pute"i s face"i un script PHP s ruleze fr un server inavigator #eb' 7ve"i nevoie doar de analizatorul PHP pentru a-l utiliza !n acest mod' 7cestmod de utilizare este ideal pentru script-uri e*ecutate !n mod regulat cu cron (pe 8ni* sau

    &inu*) sau cu $as6 .cheduler (pe 9indo#s)' 7ceste script-uri pot fi utilizate de asemeneapentru lucrri simple de procesare a te*telor' Citi"i sec"iunea despre tilizarea PHP !n liniade comandpentru informa"ii suplimentare'

    .crierea aplica"iilor de birou' PHP probabil c nu este cel mai potrivit limbaj pentru a crea oaplica"ie de birou cu o interfa" grafic a utilizatorului, dar dac cunoate"i PHP foarte binei dori"i s utiliza"i unele facilit"i avansate ale PHP !n aplica"ii de partea clientului, pute"i sutiliza"i PHP-4$: pentru a scrie asemenea aplica"ii' 2e asemenea ave"i posibilitatea sscrie"i !n acest mod aplica"ii ce vor rula pe mai multe platforme' PHP-4$: este o e*tensie aPHP, care nu este disponibil !n distributivul de baz' 2ac v-a interesat PHP-4$:, vizita"i; propriul su #ebsite'

    PHP poate fiutilizatpe toate sistemele de operare majore, inclusiv &inu*, multe variante ni*(inclusiv HP-

  • 8/14/2019 133344830 Php Pentru Incepatori

    3/77

    na dintre cele mai puternice i semnificative facilit"i ale PHP este sus"inerea unui larg domeniude baze de date'.crierea unei pagini #eb ce acceseaz o baz de date este incredibl de simplutiliz0nd una din e*tensiile de lucru cu baze de date (de e*' pentru ms@l), sau utiliz0nd un nivel deabstractizare precum P23,sau conectarea la orice baz de date ce sus"ine standardul 3pen2atabase Connection cu ajutorul e*tensiei 32=C' 7lte baze de date pot utiliza c>&sausoc6et-uri, cum ar fi Couch2='

    PHP de asemenea poate s converseze cu alte servicii utiliz0nd protocoale cum ar fi &27P,5%7P, .A%P, AA$P, P3PB, H$$P, C3% (pe 9indo#s) i multe altele' Pute"i de asemenea sdeschide"i soc6et-uri de re"ea crude i s interac"iona"i utiliz0nd orice alt protocol' PHP sus"ine922< - schimbul de date comple*e !ntre aproape toate limbajele de programare #eb' orbinddespre interconectare, PHP sus"ine instan"ierea obiectelor 1ava i utilizarea lor transparent caobiecte PHP'

    PHP posed facilit"i de procesare a te*tuluifoarte utile, care includ e*presii regulare compatibilecu Perl (PC>D) i multe e*tensii i instrumente pentru accesarea i interpretarea documentelor

  • 8/14/2019 133344830 Php Pentru Incepatori

    4/77

    What do I need?5n this tutorial #e assume that our server has activated support for PHP and that all files ending in.phpare handled b PHP' 3n most servers, this is the default e*tension for PHP files, but as6 ourserver administrator to be sure' 5f our server supports PHP, then ou do not need to do anthing'1ust create our .phpfiles, put them in our #eb director and the server #ill automaticall parsethem for ou' $here is no need to compile anthing nor do ou need to install an e*tra tools' $hin6of these PHP-enabled files as simple H$%& files #ith a #hole ne# famil of magical tags that letou do all sorts of things' %ost #eb hosts offer PHP support, but if our host does not, considerreading the ; PHP &in6s section for resources on finding PHP enabled #eb hosts'

    &et us sa ou #ant to save precious band#idth and develop locall' 5n this case, ou #ill #ant toinstall a #eb server, such as ; 7pache , and of course; PHP' Fou #ill most li6el #ant to install adatabase as #ell, such as ; %.& '

    Fou can either install these individuall or choose a simpler #a' 3ur manual has installationinstructions for PHP(assuming ou alread have some #eb server set up)' 5f ou have problems#ith installing PHP ourself, #e #ould suggest ou as6 our @uestions on our ; installation mailinglist' 5f ou choose to go on the simpler route, then ; locate a pre-configured pac6age for ouroperating sstem, #hich automaticall installs all of these #ith just a fe# mouse clic6s' 5t is eas tosetup a #eb server #ith PHP support on an operating sstem, including %ac3.& #ill be something li6e http://localhost/hello.phporhttp://127...1/hello.phpbut this depends on the #eb serverGs configuration' 5f everthing isconfigured correctl, this file #ill be parsed b PHP and the follo#ing output #ill be sent to ourbro#ser+

  • 8/14/2019 133344830 Php Pentru Incepatori

    5/77

  • 8/14/2019 133344830 Php Pentru Incepatori

    6/77

    Ao# that ou have successfull created a #or6ing PHP script, it is time to create the most famousPHP script/ %a6e a call to the phpinfo()function and ou #ill see a lot of useful information aboutour sstem and setup such as available predefined variables, loaded PHP modules, andconfigurationsettings' $a6e some time and revie# this important information'

    Example #, -et s.stem information from PHP

  • 8/14/2019 133344830 Php Pentru Incepatori

    7/77

    Here #e introduce a couple of ne# concepts' 9e have an ifstatement' 5f ou are familiar #ith thebasic snta* used b the C language, this should loo6 logical to ou' 3ther#ise, ou shouldprobabl pic6 up an introductor PHP boo6 and read the first couple of chapters, or read the&anguage >eferencepart of the manual'

    $he second concept #e introduced #as thestrpos()function call'strpos()is a function built intoPHP #hich searches a string for another string' 5n this case #e are loo6ing for M+3E(so-calledneedle) inside *_+ER,ER-HTTP_U+ER_0ENT(so-called hastac6)' 5f the needle is foundinside the hastac6, the function returns the position of the needle relative to the start of thehastac6' 3ther#ise, it returns FALSE' 5f it does not return FALSE, theife*pression evaluates toTRUEand the code #ithin its bracesQ is e*ecuted' 3ther#ise, the code is not run' eel free tocreate similar e*amples, #ith if, else,and other functions such as strtoupper()and strlen()' Dachrelated manual page contains e*amples too' 5f ou are unsure ho# to use functions, ou #ill #ant toread both the manual page on ho# to read a function definitionand the section aboutPHPfunctions'

    9e can ta6e this a step further and sho# ho# ou can jump in and out of PHP mode even in themiddle of a PHP bloc6+

    Example #2 3ixin "oth H*3( and PHP modes

    ?ET6@ 6MIE69 !AA >LE9 ,

  • 8/14/2019 133344830 Php Pentru Incepatori

    8/77

    Example #1 A simple H*3( form

  • 8/14/2019 133344830 Php Pentru Incepatori

    9/77

    of PHP ; J'E'L the PHP directive registerRglobalsis o

  • 8/14/2019 133344830 Php Pentru Incepatori

    10/77

    #eb i un navigator #eb' Probabil deja ave"i un navigator #eb i, !n dependen" de sistemuldumneavoastr de operare, pute"i s ave"i i un server #eb (de e*' 7pache pe &inu* i %ac3.

  • 8/14/2019 133344830 Php Pentru Incepatori

    11/77

    $his section #ill guide ou through the general configuration and installation of PHP on ni*sstems' =e sure to investigate an sections specific to our platform or #eb server before oubegin the process'

    7s our manual outlines in the 4eneral 5nstallation Considerationssection, #e are mainl dealing#ith #eb centric setups of PHP in this section, although #e #ill cover setting up PHP for commandline usage as #ell'

    $here are several #as to install PHP for the ni* platform, either #ith a compile and configureprocess, or through various pre-pac6aged methods' $his documentation is mainl focused aroundthe process of compiling and configuring PHP' %an ni* li6e sstems have some sort of pac6ageinstallation sstem' $his can assist in setting up a standard configuration, but if ou need to have adifferent set of features (such as a secure server, or a different database driver), ou ma need tobuild PHP andIor our #eb server' 5f ou are unfamiliar #ith building and compiling our o#nsoft#are, it is #orth chec6ing to see #hether somebod has alread built a pac6aged version of PHP#ith the features ou need'

    Prere@uisite 6no#ledge and soft#are for compiling+

    =asic ni* s6ills (being able to operate ma6e and a C compiler) 7n 7A.5 C compiler 7 #eb server 7n module specific components (such as 42, P2 libs, etc')

    9hen building directl from 4it sources or after custom modifications ou might also need+

    autoconf+ E'KBS (for PHP T O'J'L), E'OUS (for PHP VW O'J'L) automa6e+ K'JS libtool+ K'J'*S (e*cept K'J'E) reEc+ ersion L'KB'J or ne#er

    fle*+ ersion E'O'J (for PHP TW O'E) bison+ ersion K'EX (preferred), K'BO, or K'YO

    $he initial PHP setup and configuration process is controlled b the use of the command lineoptions of the confiurescript' Fou could get a list of all available options along #ith shorte*planations running 78confiure !!help' 3ur manual documents the different options separatel'Fou #ill find the core options in the appendi*, #hile the different e*tension specific options aredescibed on the reference pages'

    9hen PHP is configured, ou are read to build the module andIor e*ecutables' $he commandma9eshould ta6e care of this' 5f it fails and ou canGt figure out #h, see the Problems section'

    Apache 1727x on Unix s.stems$his section contains notes and hints specific to 7pache installs of PHP on ni* platforms' 9e alsohave instructions and notes for 7pache E on a separate page'

    Fou can select arguments to add to the confiureon line KL belo# from the list of core configureoptionsand from e*tension specific options described at the respective places in the manual' $heversion numbers have been omitted here, to ensure the instructions are not incorrect' Fou #ill needto replace the G***G here #ith the correct values from our files'

    Example #1 Installation Instructions 0Apache /hared 3odule :ersion for PHP1. 'ni$ a$a2#*;.tar.'G. tar -7 a$a2#*;.tar

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.generalhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.generalhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#configurehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.problemshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.unix.apache2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.unix.apache2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#configurehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#configurehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.generalhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#configurehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.problemshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.unix.apache2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#configurehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#configure
  • 8/14/2019 133344830 Php Pentru Incepatori

    12/77

    3. 'ni$ $#$-.tar.'4. tar -7 $#$-.tar. 2+ a$a2#*;J. ./2n7i'r* --$r*7iA/&&& --*na*-)+*AsK. )a*. )a* instaN. 2+ ../$#$-

    10. & 2n7i'r* r PHP. T#is is *r* 2st)i* r PHP &it# aris $tins i* i2# *t*nsins &i * *na*+. D a ./2n7i'r* --#*$ 7r a ist 7 aaia* $tins. In r *a)$* &*6 + a si)$* 2n7i'r* &it# >$a2#* 1 an+ ML s$$rt. Yr $at# t a$s )a +i77*r 7r) r *a)$*.

    ./2n7i'r* --&it#-)s --&it#-a$sA/&&&/in/a$s

    11. )a*1G. )a* insta

    I7 +*2i+* t 2#an'* r 2n7i'r* $tins a7t*r instaatin

    n n**+ t r*$*at t#* ast t#r** st*$s. Y n n**+ tr*start a$a2#* 7r t#* n*& )+* t ta* *77*2t. > r*2)$i* 7

    >$a2#* is nt n**+*+.

    t* t#at n*ss t+ t#*r&is* 6)a* insta6 &i as insta PE>( aris PHP ts s2# as $#$i* insta t#* PHP CLI an+ )r*.

    13. *t$ r $#$.ini 7i*%

    2$ $#$.ini-+**$)*nt /sr/2a/i/$#$.ini

    Y )a *+it r .ini 7i* t s*t PHP $tins. I7 $r*7*r r $#$.ini in ant#*r 2atin s* --&it#-2n7i'-7i*-$at#A/s)*/$at# in

    st*$ 10.

    I7 inst*a+ 2#s* $#$.ini-$r+2tin * 2*rtain t r*a+ t#* ist 7 2#an'*s &it#in as t#* a77*2t #& PHP *#a*s.

    14. E+it r #tt$+.2n7 t a+ t#* PHP )+*. T#* $at# n t#* ri'#t #an+ si+* 7 t#* La+M+* stat*)*nt )st $int t t#* $at# 7 t#* PHP )+* n r sst*). T#* )a* insta 7r) a* )a #a* ar*a+ a++*+ t#is 7r t * sr* t 2#*2.

    La+M+* $#$;)+* i**2/i$#$.s1. >n+ in t#* >++M+* s*2tin 7 #tt$+.2n7 s)**r* n+*r t#* C*arM+*List a++ t#is%

    >++M+* )+;$#$.2

    1J. T* >$a2#* t $ars* 2*rtain *t*nsins as PHP. r *a)$* *t6s #a* >$a2#* $ars* t#* .$#$ *t*nsin as PHP. Y 2+ #a* an *t*nsin8s9 $ars* as PHP si)$ a++in' )r* &it# *a2# s*$arat*+ a s$a2*. W*6 a++ .$#t) t +*)nstrat*.

    >++T$* a$$i2atin/-#tt$+-$#$ .$#$ .$#t)

    It6s as 2))n t s*t$ t#* .$#$s *t*nsin t s#& #i'#i'#t*+ PHP

    sr2* t#is 2an * +n* &it#%>++T$* a$$i2atin/-#tt$+-$#$-sr2* .$#$s

  • 8/14/2019 133344830 Php Pentru Incepatori

    13/77

    1K. Us* r nr)a $r2*+r* 7r startin' t#* >$a2#* s*r*r. 8Y )st st$ an+ r*start t#* s*r*r nt Qst 2as* t#* s*r*r t r*a+ sin' a HUP r U(1 si'na.9

    7lternativel, to install PHP as a static object+

    Example #, Installation Instructions 0/tatic 3odule Installation for Apache for PHP

    1. 'ni$ -2 a$a2#*;1.3..tar.' R tar 7 -G. 2+ a$a2#*;1.3.3. ./2n7i'r*4. 2+ ..

    . 'ni$ -2 $#$-...tar.' R tar 7 -J. 2+ $#$-..K. ./2n7i'r* --&it#-)s --&it#-a$a2#*A../a$a2#*;1.3.. )a*N. )a* insta

    10. 2+ ../a$a2#*;1.3.

    11. ./2n7i'r* --$r*7iA/&&& --a2tiat*-)+*Asr2/)+*s/$#$/i$#$.a 8T#* a* in* is 2rr*2t! Y*s &* n& i$#$.a +*s nt *ist at t#is sta'*. It isn6t s$$s*+ t. It &i * 2r*at*+.9

    1G. )a* 8 s#+ n& #a* an #tt$+ inar i2# 2an 2$ t r >$a2#* in+ir i7 it is r 7irst insta t#*n n**+ t ")a* insta" as &*9

    13. 2+ ../$#$-..14. 2$ $#$.ini-+**$)*nt /sr/2a/i/$#$.ini

    1. Y 2an *+it /sr/2a/i/$#$.ini 7i* t s*t PHP $tins. E+it r #tt$+.2n7 r sr).2n7 7i* an+ a++% >++T$* a$$i2atin/-#tt$+-$#$ .$#$

    2epending on our 7pache install and ni* variant, there are man possible #as to stop andrestart the server' =elo# are some tpical lines used in restarting the server, for differentapacheIuni* installations' Fou should replace/path/to/#ith the path to these applications on oursstems'

    Example #2 Example commands for restartin Apache

    1. **ra Lin an+ s ariants%/*t2/r2.+/init.+/#tt$+ r*start

    G. Usin' a$a2#*2t s2ri$ts%/$at#/t/a$a2#*2t st$/$at#/t/a$a2#*2t start

    3. #tt$+2t an+ #tt$s+2t 8Usin' O$*nL9 si)iar t a$a2#*2t%/$at#/t/#tt$s+2t st$/$at#/t/#tt$s+2t start

    4. Usin' )+;ss r ant#*r L s*r*r )a &ant t )anast$ an+ start%/$at#/t/a$a2#*2t st$/$at#/t/a$a2#*2t startss

    $he locations of the apachectl and http(s)dctl binaries often var' 5f our sstem has locateor=here)sor =h)chcommands, these can assist ou in finding our server control programs'

  • 8/14/2019 133344830 Php Pentru Incepatori

    14/77

    2ifferent e*amples of compiling PHP for apache are as follo#s+

    ./2n7i'r* --&it#-a$s --&it#-$'s

    $his #ill create a l)[email protected] librar that is loaded into 7pache using a &oad%odule line in7pacheGs http".co#

  • 8/14/2019 133344830 Php Pentru Incepatori

    15/77

    Averti

  • 8/14/2019 133344830 Php Pentru Incepatori

    16/77

    5f ou decide to change our configure options after installation, ouGll need to re-run theconfigure, ma6e, and ma6e install steps' Fou onl need to restart apache for the ne# moduleto ta6e effect' 7 recompile of 7pache is not needed'

    Aote that unless told other#ise, Gma6e installG #ill also install PD7>, various PHP tools suchas phpize, install the PHP C&5, and more'

    N' .etup our php'ini2$ $#$.ini-+**$)*nt /sr/2a/i/$#$.ini

    Fou ma edit our 'ini file to set PHP options' 5f ou prefer having php'ini in anotherlocation, use --#ith-config-file-pathWIsomeIpath in step O'

    5f ou instead choose php'ini-production, be certain to read the list of changes #ithin, asthe affect ho# PHP behaves'

    Y' Ddit our httpd'conf to load the PHP module' $he path on the right hand side of the&oad%odule statement must point to the path of the PHP module on our sstem' $he ma6einstall from above ma have alread added this for ou, but be sure to chec6'

    La+M+* $#$;)+* )+*s/i$#$.s

    X' $ell 7pache to parse certain e*tensions as PHP' or e*ample, letGs have 7pache parse 'phpfiles as PHP' 5nstead of onl using the 7pache 7dd$pe directive, #e #ant to avoidpotentiall dangerous uploads and created files such as e*ploit'php'jpg from being e*ecutedas PHP' sing this e*ample, ou could have an e*tension(s) parse as PHP b simpl addingthem' 9eGll add 'php to demonstrate'

  • 8/14/2019 133344830 Php Pentru Incepatori

    17/77

    s*ri2* #tt$+ r*start

    ollo#ing the steps above ou #ill have a running 7pacheE #eb server #ith support for PHP as a+P3module' 3f course there are man more configuration options available 7pache and PHP' ormore information tpe 78confiure !!helpin the corresponding source tree'

    7pache ma be built multithreaded b selecting the =orer%P%, rather than the standardpre

  • 8/14/2019 133344830 Php Pentru Incepatori

    18/77

    ")in-$r2s" A, 1 ")a-$r2s" A, 1 "i+*-ti)*t" A, G0 999

    $he bin-path directive allo#s lighttpd to spa#n fastcgi processes dnamicall' PHP #ill spa#n

    children according to the PHPRC45RCH5&2>DA environment variable' $he bin-environmentdirective sets the environment for the spa#ned processes' PHP #ill 6ill a child process after thenumber of re@uests specified b PHPRC45R%7DD.$. is reached' $he directives min-procs and ma*-procs should generall be avoided #ith PHP' PHP manages its o#n children andopcode caches li6e 7PC #ill onl share among children managed b PHP' 5f min-procs is set tosomething greater than K, the total number of php responders #ill be multipliedPHPRC45RCH5&2>DA (E min-procs 8 KN children gives BE responders)'

    /pa+nin +ith spa+n!fci

    &ighttpd provides a program called spa#n-fcgi to ease the process of spa#ning fastcgi processes

    easier'

    /pa+nin php!ci

    5t is possible to spa#n processes #ithout spa#n-fcgi, though a bit of heav-lifting is re@uired'.etting the PHPRC45RCH5&2>DA environment var controls ho# man children PHP #ill spa#nto handle incoming re@uests' .etting PHPRC45R%7DD.$. #ill determine ho# long (inre@uests) each child #ill live' HereGs a simple bash script to help spa#n php responders'

    Example #, /pa+nin )astC-I >esponders

    S!/in/s#

    S L2atin 7 t#* $#$-2'i inarPHPA/sr/2a/in/$#$-2'i

    S PID i* 2atinPHP;PIDA/t)$/$#$.$i+

    S Bin+in' t an a++r*ssSC?I;BID;>DD(EA10.0.1.1%10000S Bin+in' t a +)ain s2*tC?I;BID;>DD(EA/t)$/$#$.s2

    PHP;C?I;CHILD(EA1J

    PHP;C?I;M>;(EUETA10000

    *n -i PHP;C?I;CHILD(EA:PHP;C?I;CHILD(E PHP;C?I;M>;(EUETA:PHP;C?I;M>;(EUET :PHP - :C?I;BID;>DD(E X

    *2# :! , ":PHP;PID"

    Connectin to remote )C-I instances

    astcgi instances can be spa#ned on multiple remote machines in order to scale applications'Example #2 Connectin to remote php!fastci instances

    7ast2'i.s*r*r A 8 ".$#$" A,

  • 8/14/2019 133344830 Php Pentru Incepatori

    19/77

    88 "#st" A, "10.0.0.G" "$rt" A, 1030 9 8 "#st" A, "10.0.0.3" "$rt" A, 1030 999

    /un iPlanet and &etscape servers on /un /olaris$his section contains notes and hints specific to .un 1ava .stem 9eb .erver, .un 3AD 9eb.erver, iPlanet and Aetscape server installs of PHP on .un .olaris'

    rom PHP J'B'B on ou can use PHP scripts #ith the A.7P5 moduleto generate custom directorlistings and error pages' 7dditional functions for 7pache compatibilit are also available' orsupport in current #eb servers read the note about subre@uests'

    Fou can find more information about setting up PHP for the Aetscape Dnterprise .erver (AD.)here+ ; http+IIbenoit'noss'free'frIphpIinstall-phpJ'html

    $o build PHP #ith .un 1.9.I.un 3AD 9.IiPlanetIAetscape #eb servers, enter the proper installdirector for the --#ith-nsapiW[25>\option' $he default director is usuall

    /opt/#etscape/s%)tespot/' Please also read/phpBxxxBers)o#/sap)/#sap)/#sap)Brea"6e.txt'

    K' 5nstall the follo#ing pac6ages from ; http+II###'sunfree#are'comI or another do#nloadsite+

    a%toco#

  • 8/14/2019 133344830 Php Pentru Incepatori

    20/77

    Confiuration Instructions for /un8iPlanet8&etscape

    irstl ou ma need to add some paths to the;D_;3IRRJ_PTHenvironment for the server tofind all the shared libs' $his can best done in the start script for our #eb server' $he start script isoften located in+/path/to/serer/httpsBserer#a6e/start' Fou ma also need to edit the configurationfiles that are located in+/path/to/serer/httpsBserer#a6e/co#L/path/to/"ocrootL specific to the conte*tphp?_exec%teiscalled' or boolean ini-6es please use LIK as value, not LO#LLOLO#L

    J' $his is onl needed if ou #ant to configure a director that onl consists of PHP scripts

    (same li6e a c)B$)#director)+

  • 8/14/2019 133344830 Php Pentru Incepatori

    21/77

    >t#Trans 7nA$#$4;at#;trans...

  • 8/14/2019 133344830 Php Pentru Incepatori

    22/77

    7nother possibilit is to generate self-made director listings' 1ust create a PHP script #hichdisplas a director listing and replace the corresponding default +er)celine for type>L6a#%sB)#ter#al/")rectoryLin o$K.co#5 and translated >5 are in the variables*_+ER,ER-PTH_3NOand *_+ER,ER-PTH_TRN+;TED'

    &ote a"out nsapivirtual0and su"reBuests 0PHP @; =7272

    $he A.7P5 module no# supports the nsapiRvirtual()function (alias+ virtual()) to ma6e subre@uestson the #eb server and insert the result in the #eb page' $his function uses some undocumentedfeatures from the A.7P5 librar' 3n ni* the module automaticall loo6s for the needed functionsand uses them if available' 5f not, nsapiRvirtual()is disabled'

    &ot'+

    =ut be #arned+ .upport for nsapiRvirtual()is D5%DA$7&///

    C-I and command line setups= default, PHP is built as both a C&5 and C45 program, #hich can be used for C45 processing' 5fou are running a #eb server that PHP has module support for, ou should generall go for thatsolution for performance reasons' Ho#ever, the C45 version enables users to run different PHP-

    enabled pages under different user-ids'Averti

  • 8/14/2019 133344830 Php Pentru Incepatori

    23/77

    HP!U specific installation notes$his section contains notes and hints specific to installing PHP on HP-< sstems'

    $here are t#o main options for installing PHP on HP-< sstems' Dither compile it, or install apre-compiled binar'

    3fficial pre-compiled pac6ages are located here+ ; http+IIsoft#are'hp'comIntil this manual section is re#ritten, the documentation about compiling PHP (and relatede*tensions) on HP-< sstems has been removed' or no#, consider reading the follo#ing e*ternalresource+ ; =uilding 7pache and PHP on HP-< KK'KK

    $penD/4 installation notes

    $his section contains notes and hints specific to installing PHP on ; 3pen=.2 B'N'

    Usin Dinar. Pac9aes

    sing binar pac6ages to install PHP on 3pen=.2 is the recommended and simplest method' $hecore pac6age has been separated from the various modules, and each can be installed and removedindependentl from the others' $he files ou need can be found on our 3pen=.2 C2 or on the$P site'

    $he main pac6age ou need to install isphp?BcoreB?...t, #hich contains the basic engine (plusgette*t and iconv)' Ae*t, ta6e a loo6 at the module pac6ages, such asphp?B6ysAlB?...torphp?B)6apB?...t' Fou need to use the phpxscommand to activate and deactivate these modules in

    ourphp.)#)'

    Example #1 $penD/4 Pac9ae Install Example

    S $';a++ $#$4-2r*-4.3..t'S /sr/2a/sin/$#$s -sS 2$ /sr/2a/s#ar*/+2/$#$4/$#$.ini-r*2))*n+*+ /ar/&&&/2n7/$#$.ini 8a++ in )s9S $';a++ $#$4-)s-4.3..t'S /sr/2a/sin/$#$s -a )s 8a++ in i)a$9S $';a++ $#$4-i)a$-4.3..t'S /sr/2a/sin/$#$s -a i)a$

    8r*)* )s as a t*st9S $';+**t* $#$4-)s-4.3.S /sr/2a/sin/$#$s -r )s 8insta t#* PE>( irari*s9S $';a++ $#$4-$*ar-4.3..t'

    >ead the ; pac6ages(Y) manual page for more information about binar pac6ages on 3pen=.2'

    Usin Ports

    Fou can also compile up PHP from source using the ; ports tree' Ho#ever, this is onlrecommended for users familiar #ith 3pen=.2' $he PHP J port is split into t#o sub-directories+core and e*tensions' $he e*tensions director generates sub-pac6ages for all of the supported PHPmodules' 5f ou find ou do not #ant to create some of these modules, use the no&73>' ore*ample, to s6ip building the imap module, set the &73> to noimap'

    http://software.hp.com/http://www.tekwire.net/joomla/building/apache/http-hpux-11-11http://www.openbsd.org/http://www.openbsd.org/http://www.openbsd.org/cgi-bin/man.cgi?query=packageshttp://www.openbsd.org/faq/ports/ports.htmlhttp://software.hp.com/http://www.tekwire.net/joomla/building/apache/http-hpux-11-11http://www.openbsd.org/http://www.openbsd.org/cgi-bin/man.cgi?query=packageshttp://www.openbsd.org/faq/ports/ports.html
  • 8/14/2019 133344830 Php Pentru Incepatori

    24/77

    Common Pro"lems

    $he default install of 7pache runs inside a ; chroot(E) jail, #hich #ill restrict PHP scripts toaccessing files under/ar/===' Fou #ill therefore need to create a/ar/===/t6pdirectorfor PHP session files to be stored, or use an alternative session bac6end' 5n addition,database soc6ets need to be placed inside the jail or listen on the localhostinterface' 5f ou

    use net#or6 functions, some files from/etcsuch as/etc/resol.co#. sstem to compile up a staticall lin6ed PHP' .ince

    it is hard to generate binar pac6ages using this method, it is no# deprecated' Fou can still use theold stable ports trees if ou #ish, but the are unsupported b the 3pen=.2 team' 5f ou have ancomments about this, the current maintainer for the port is 7nil %adhavapedd (avsm at openbsddot org)'

    /olaris specific installation tips$his section contains notes and hints specific to installing PHP on .olaris sstems'

    >eBuired soft+are

    .olaris installs often lac6 C compilers and their related tools' >ead this 7for information on#h using 4A versions for some of these tools is necessar'

    or unpac6ing the PHP distribution ou need

    tar gzip or bzipE

    or compiling PHP ou need gcc (recommended, other C compilers ma #or6) ma6e 4A sed

    or building e*tra e*tensions or hac6ing the code of PHP ou might also need

    fle* (up to PHP O'E) reEc bison mJ autoconf automa6e

    http://www.openbsd.org/cgi-bin/man.cgi?query=chroothttp://www.openbsd.org/faq/faq10.html#httpdchroothttp://www.libgd.org/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.needgnuhttp://www.openbsd.org/cgi-bin/man.cgi?query=chroothttp://www.openbsd.org/faq/faq10.html#httpdchroothttp://www.libgd.org/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.needgnu
  • 8/14/2019 133344830 Php Pentru Incepatori

    25/77

    5n addition, ou #ill need to install (and possibl compile) an additional soft#are specific to ourconfiguration, such as 3racle or %.&'

    Usin Pac9aes

    Fou can simplif the .olaris install process b using p6gadd to install most of our needed

    components' $he 5mage Pac6aging .stem (5P.) for .olaris KK D*press also contains most of there@uired components for installation using the p6g command'

    4e"ian -&U8(inux installation notes$his section contains notes and hints specific to installing PHP on ; 2ebian 4AI&inu*'

    Averti'

    .econd, before installing a pac6age, itGs #ise to ensure the pac6age list is up to date' $picall, thisis done b running the command apt!et update'

    Example #1 4e"ian Install Example +ith Apache ,

    S a$t-'*t insta $#$-2))n ia$a2#*G-)+-$#$ $#$-2i

    7P$ #ill automaticall install the PHP O module for 7pache E and all of its dependencies, and thenactivate it' 7pache should be restarted in order for the changes ta6e place' or e*ample+

    Example #, /toppin and startin Apache once PHP is installed

    S /*t2/init.+/a$a2#*G st$

    S /*t2/init.+/a$a2#*G start

    Detter control of confiuration

    5n the last section, PHP #as installed #ith onl core modules' 5tGs ver li6el that additionalmodules #ill be desired, such as %.&,c>&, 42, etc' $hese ma also be installed via the aptBetcommand'

    Example #2 3ethods for listin additional PHP F pac9aes

    S a$t-2a2#* s*ar2# $#$S a$tit+* s*ar2# $#$

    S a$tit+* s*ar2# $#$ R'r*$ -i )s

    $he e*amples #ill sho# a lot of pac6ages including several PHP specific ones li6e phpO-cgi, phpO-

    http://www.debian.org/http://www.php.net/downloads.phphttp://www.php.net/downloads.phphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.curlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.curlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imagehttp://www.debian.org/http://www.php.net/downloads.phphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.curlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.image
  • 8/14/2019 133344830 Php Pentru Incepatori

    26/77

    cli and phpO-dev' 2etermine #hich are needed and install them li6e an other #ith either aptBetorapt)t%"e' 7nd because 2ebian performs dependenc chec6s, itGll prompt for those so for e*ample toinstall %.& and c>&+

    Example #= Install PHP +ith 3./G( cU>(

    S a$t-'*t insta $#$-)s $#$-2r

    7P$ #ill automaticall add the appropriate lines to the differentphp.)#)related files li6e/etc/php@/apache2/php.)#),/etc/php@/co#

  • 8/14/2019 133344830 Php Pentru Incepatori

    27/77

    Dntrop+ ; http+II###'entrop'chIsoft#areImacos*IphpI in6+ ; http+II###'fin6project'orgI Homebre#+ ; http+IIgithub'comIm*clIhomebre#

    Usin the "undled PHPPHP has come standard #ith %acs since 3. < version KL'L'L' Dnabling PHP #ith the default #ebserver re@uires uncommenting a fe# lines in the 7pache configuration file http".co#

  • 8/14/2019 133344830 Php Pentru Incepatori

    28/77

    >++T$* a$$i2atin/-#tt$+-$#$-sr2* .$#$s

    S in2* )st s*rs &i &ant in+*.$#$ t &r &* S as at)ati2a *na* in+*.$#$

  • 8/14/2019 133344830 Php Pentru Incepatori

    29/77

    Installation on Windo+s s.stems

    Cuprins

    9indo#s 5nstaller (PHP O'K'L and earlier) 9indo#s 5nstaller (PHP O'E and later) %anual 5nstallation .teps %icrosoft 55. %icrosoft 55. O'K and 55. N'L %icrosoft 55. Y'L and later 7pache K'B'* on %icrosoft 9indo#s 7pache E'* on %icrosoft 9indo#s .un, iPlanet and Aetscape servers on %icrosoft 9indo#s .ambar .erver on %icrosoft 9indo#s

  • 8/14/2019 133344830 Php Pentru Incepatori

    30/77

    9hile the 9indo#s installer is an eas #a to ma6e PHP #or6, it is restricted in manaspects as, for e*ample, the automatic setup of e*tensions is not supported' se of theinstaller isnGt the preferred method for installing PHP'

    irst, install our selected H$$P (#eb) server on our sstem, and ma6e sure that it #or6s'

    >un the e*ecutable installer and follo# the instructions provided b the installation #izard' $#o

    tpes of installation are supported - standard, #hich provides sensible defaults for all the settings itcan, and advanced, #hich as6s @uestions as it goes along'

    $he installation #izard gathers enough information to set up thephp.)#)file, and configure certain#eb servers to use PHP' 3ne of the #eb servers the PHP installer does not configure for is 7pache,so ouGll need to configure it manuall'

    3nce the installation has completed, the installer #ill inform ou if ou need to restart our sstem,restart the server, or just start using PHP'

    Averti

  • 8/14/2019 133344830 Php Pentru Incepatori

    31/77

    /ilent Install

    $he installer also supports a silent mode, #hich is helpful for .stems 7dministrators to deploPHP easil' $o use silent mode+

    )si**2.** /i $#$-E(IO-&in3G-insta.)si /

    Fou can control the install director b passing it as a parameter to the install' or e*ample, toinstall to e+^php+

    )si**2.** /i $#$-E(IO-&in3G-insta.)si / IT>LLDI(A*%$#$

    Fou can also use the same snta* to specif the 7pache Configuration 2irector (7P7CHD25>),the .ambar .erver director (.7%=7>25>), and the DDLOC>LA2'i*t;$#$;)si

    $he current list of eatures to install is as follo#s+

    MainE*2ta* - $#$.** **2ta* 8 n n'*r aaia* as 7 PHP.G.10/.3.05 it is n& in2+*+ +*7at 92ri$tE*2ta* - $#$-&in.** **2ta**t;$#$; - t#* aris *t*nsins 8 7r *a)$*% *t;$#$;)s 7r ML 9a$a2#*13 - >$a2#* 1.3 )+*a$a2#*G0 - >$a2#* G.0 )+*a$a2#*GG - >$a2#* G.G )+*

    a$a2#*C?I - >$a2#* C?I **2ta*iis4I>PI - II I>PI )+*iis4C?I - II C?I **2ta*iis4astC?I - II C?I **2ta*>PI - n/iPan*t/*ts2a$* s*r*r )+*n*ts*r* - *t*r* W* *r*r C?I **2ta*ita)i - ita)i C?I **2ta*a)ar - a)ar *r*r I>PI )+*C?I - $#$-2'i.** **2ta*PE>( - PE>( insta*rMana - PHP Mana in CHM r)at

    or more information on installing %.5 installers from the command line, visit; http+IImsdn'microsoft'comIen-usIlibrarIaaBNYUXX'asp*

    Upradin PHP +ith the Install

    $o upgrade, run the installer either graphicall or from the command line as normal' $he installer#ill read our current install options, remove our old installation, and reinstall PHP #ith the sameoptions as before' 5t is recommended that ou use this method of 6eeping PHP updated instead ofmanuall replacing the files in the installation director'

    http://msdn.microsoft.com/en-us/library/aa367988.aspxhttp://msdn.microsoft.com/en-us/library/aa367988.aspx
  • 8/14/2019 133344830 Php Pentru Incepatori

    32/77

    3anual Installation /teps$his section contains instructions for manuall installing and configuring PHP on %icrosoft9indo#s' or the instructions on ho# to use PHP installer to setup and configure PHP and a #ebserver on 9indo#s refer to 9indo#s 5nstaller (PHP O'E and later)'

    /electin and do+nloadin the PHP distri"ution pac9ae

    2o#nload the PHP zip binar distribution from ; PHP for 9indo#s+ =inaries and .ources' $hereare several different versions of the zip pac6age - choose the version that is suitable for the #ebserver being used+

    5f PHP is used #ith 55. then choose PHP O'B ,CG No# Threa" +auntime (*XN) or the ; %icrosoft ELLX CSS >untime (*NJ)installed'

    *he PHP pac9ae structure and content

    npac6 the content of the zip archive into a director of our choice, for e*ample C+^PHP^' $he

    director and file structure e*tracted from the zip #ill loo6 as belo#+Example #1 PHP F pac9ae structure

    2%$#$ R V--+* R R R R-$#$ts.i -- $#$.i in nn t#r*a+ sa7* *rsin R V--*t -- *t*nsin DLLs 7r PHP R R R R-$#$;G.+

    R R R R-$#$;2$+7.+ R R R R-... R V--*tras -- *)$t

    R V--$*ar -- initia 2$ 7 PE>( R R R-'-$*ar.at -- PE>( s*t$ s2ri$t R R-...

    R R-$#$-2'i.** -- C?I **2ta* R R-$#$-&in.** -- **2t*s s2ri$ts &it#t an $*n*+ 2))an+

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.installer.msihttp://windows.php.net/download/http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BFhttp://www.microsoft.com/downloads/details.aspx?FamilyID=BD2A6171-E2D6-4230-B809-9A8D7548C1B6http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.installer.msihttp://windows.php.net/download/http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BFhttp://www.microsoft.com/downloads/details.aspx?FamilyID=BD2A6171-E2D6-4230-B809-9A8D7548C1B6
  • 8/14/2019 133344830 Php Pentru Incepatori

    33/77

    $r)$t R R-$#$.** -- C))an+ in* PHP **2ta* 8CLI9 R R-... R R-$#$.ini-+**$)*nt -- +*7at $#$.ini s*ttin's

    R R-$#$.ini-$r+2tin -- r*2))*n+*+ $#$.ini s*ttin's R R-$#$a$a2#*G;G.+ -- +*s nt *ist in nn t#r*a+ sa7* *rsin R R-$#$a$a2#*G;G;7it*r.+ -- +*s nt *ist in nn t#r*a+ sa7* *rsin R R-... R R-$#$ts.+ -- 2r* PHP DLL 8 $#$.+ in nn t#r*a+ sa7**rsin9 R

    R-...

    =elo# is the list of the modules and e*ecutables included in the PHP zip distribution+

    oBpear.$at- the PD7> setup script' >efer to ; 5nstallation (PD7>) for more details'

    phpBc).exe- C45 e*ecutable that can be used #hen running PHP on 55. via C45 orastC45'

    phpB=)#.exe- the PHP e*ecutable for e*ecuting PHP scripts #ithout using a command line#indo# (for e*ample PHP applications that use 9indo#s 45)'

    php.exe- the PHP e*ecutable for e*ecuting PHP scripts #ithin a command line interface

    (C&5)'

    php@apache2_2."ll- 7pache E'E'< module'

    php@apache2_2_

  • 8/14/2019 133344830 Php Pentru Incepatori

    34/77

    lo_errorsW O#- PHP has an error logging facilit that can be used to send errors to a file,or to a service (i'e' sslog) and #or6s in conjunction #ith the error_lodirective belo#'9hen running under 55., the lo_errorsshould be enabled, #ith a valid error_lo'

    error_loW &path to the error lo

  • 8/14/2019 133344830 Php Pentru Incepatori

    35/77

    3icrosoft II/$his section contains PHP installation instructions specific to %icrosoft 5nternet 5nformation.ervices (55.)'

    %anuall installing PHP on %icrosoft 55. O'K and 55. N'L %anuall installing PHP on %icrosoft 55. Y'L and later

    3icrosoft II/ F71 and II/ 7$his section contains instructions for manuall setting up 5nternet 5nformation .ervices (55.) O'Kand 55. N'L to #or6 #ith PHP on %icrosoft 9indo#s

    E refer to %icrosoft 55. Y'L and later'

    Confiurin II/ to process PHP reBuests

    2o#nload and install PHP in accordance to the instructions described in manual installation steps

    &ot'+

    Aon-thread-safe build of PHP is recommended #hen using 55.' $he non-thread-safebuilds are available at ; PHP for 9indo#s+ =inaries and .ources >eleases'

    Configure the C45- and astC45-specific settings inphp.)#)file as sho#n belo#+

    Example #1 C-I and )astC-I settins in php.ini

    7ast2'i.i)$*rsnat* A 17ast2'i.''in' A 02'i.7i;$at#in7A12'i.7r2*;r*+ir*2t A 0

    2o#nload and install the ; %icrosoft astC45 D*tension for 55. O'K and N'L' $he e*tension isavailable for BE-bit and NJ-bit platforms - select the right do#nload pac6age for our platform'

    Configure the astC45 e*tension to handle PHP-specific re@uests b running the command sho#nbelo#' >eplace the value of the -path parameter #ith the absolute file path to thephpBc).exefile'

    Example #, Confiurin )astC-I extension to handle PHP reBuests

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -a++ -s*2tin%"PHP" Z-*t*nsin%$#$ -$at#%"C%PHP$#$-2'i.**"

    $his command #ill create an 55. script mapping for 8'php file e*tension, #hich #ill result in all>&s that end #ith 'php being handled b astC45 e*tension' 7lso, it #ill configure astC45e*tension to use the e*ecutablephpBc).exeto process the PHP re@uests'

    &ot'+

    7t this point the re@uired installation and configuration steps are completed' $heremaining instructions belo# are optional but highl recommended for achieving

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis6http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis7http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis7http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manualhttp://windows.php.net/download/http://windows.php.net/download/http://www.iis.net/extensions/fastcgihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis6http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis7http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis7http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manualhttp://windows.php.net/download/http://www.iis.net/extensions/fastcgi
  • 8/14/2019 133344830 Php Pentru Incepatori

    36/77

    optimal functionalit and performance of PHP on 55.'

    Impersonation and file s.stem access

    5t is recommended to enable astC45 impersonation in PHP #hen using 55.' $his is controlled bthe RT%7CH5ADRA7%DVaccount read permission on those scripts' 5f PHP applications need to perform #rite operations oncertain files or #rite files into some folders then 5.>RT%7CH5ADRA7%DV account should have#rite permission to those'

    $o determine #hich user account is used b 55. anonmous authentication, follo# these steps+K' 5n the 9indo#s .tart %enu choose >un+, tpe inetmgr and clic6 36M

    E' D*pand the list of #eb sites under the 9eb .ites node in the tree vie#, right-clic6 on a#eb site that is being used and select PropertiesM

    B' Clic6 the 2irector .ecurit tabM

    J' $a6e note of a ser name+ field in the 7uthentication %ethods dialog

    $o modif the permissions settings on files and folders, use the 9indo#s D*plorer user interface or)caclscommand'

  • 8/14/2019 133344830 Php Pentru Incepatori

    37/77

    Example #2 Confiurin file access permissions

    i2a2s C%in*t$&&&rt$a+ /'rant IU(%8OI98CI98M9

    /et index.phpas a default document in II/

    $he 55. default documents are used for H$$P re@uests that do not specif a document name' 9ithPHP applications, )#"ex.phpusuall acts as a default document' $o add )#"ex.phpto the list of 55.default documents, follo# these steps+

    K' 5n the 9indo#s .tart %enu choose >un+, tpe inetmgr and clic6 36M

    E' >ight-clic6 on the 9eb .ites node in the tree vie# and select PropertiesM

    B' Clic6 the 2ocuments tabM

    J' Clic6 the 7dd''' button and enter inde*'php for the 2efault content page+'

    )astC-I and PHP >ec.clin confiuration

    Configure 55. astC45 e*tension settings for reccling of PHP processes b using the commandssho#n belo#' $he astC45 setting )#sta#ceMaxReA%estscontrols ho# man re@uests #ill beprocessed b a singlephpBc).exeprocess before astC45 e*tension shuts it do#n' $he PHPenvironment variablePHP_C03_M_RE8UE+T+controls ho# man re@uests a singlephpBc).exeprocess #ill handle before it reccles itself' %a6e sure that the value specified for astC45

    3#sta#ceMaxReA%estssetting is less than or e@ual to the value specified for

    PHP_C03_M_RE8UE+T+'Example #= Confiurin )astC-I and PHP rec.clin

  • 8/14/2019 133344830 Php Pentru Incepatori

    38/77

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -s*t -s*2tin%"PHP" Z-Instan2*Ma(**sts%10000

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -s*t -s*2tin%"PHP" Z-Enirn)*ntars%PHP;C?I;M>;(EUET%10000

    Confiurin )astC-I timeout settins5ncrease the timeout settings for astC45 e*tension if there are applications that have long runningPHP scripts' $he t#o settings that control timeouts arect))tyT)6eo%tandReA%estT)6eo%t' >eferto ; Configuring astC45 D*tension for 55. N'L for more information about those settings'

    Example #F Confiurin )astC-I timeout settins

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -s*t -s*2tin%"PHP" Z->2tiitTi)*t%N0

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -s*t -s*2tin%"PHP" Z-(**stTi)*t%N0

    Chanin the (ocation ofphp.inifile

    PHP searches forphp.)#)file in several locationsand it is possible to change the default locations ofphp.)#)file b usingPHPRCenvironment variable' $o instruct PHP to load the configuration filefrom a custom location run the command sho#n belo#' $he absolute path to the director #ith

    php.)#)file should be specified as a value of PHPRCenvironment variable'

    Example # Chanin the location of php.inifile

    2s2ri$t &in+irsst*)3Gin*tsr72'i2n7i'.Qs -s*t -s*2tin%"PHP" Z-Enirn)*ntars%PHP(C%"C%)*Dir*2tr"

    3icrosoft II/ J7 and later$his section contains instructions for manuall setting up 5nternet 5nformation .ervices (55.) Y'Land later to #or6 #ith PHP on %icrosoft 9indo#s ista .PK, 9indo#s Y, 9indo#s .erver ELLXand 9indo#s .erver ELLX >E' or instructions on setting up 55. O'K and 55. N'L on 9indo#s un+, tpe optionalfeatures'e*e and clic6 36M

    E' 5n the 9indo#s eatures dialog e*pand 5nternet 5nformation .ervices, 9orld 9ide9eb .ervices, 7pplication 2evelopment eatures and then enable the C45 chec6bo*M

    B' Clic6 3: and #ait until the installation is complete'

    http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis-60/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#configuration.filehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#configuration.filehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis6http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis-60/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#configuration.filehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.iis6
  • 8/14/2019 133344830 Php Pentru Incepatori

    39/77

    $o enable astC45 support on 9indo#s .erver ELLX and 9indo#s .erver ELLX >E+

    K' 5n the 9indo#s .tart %enu choose >un+, tpe Comp%gmt&auncher and clic6 36M

    E' 5f the 9eb .erver (55.) role is not present under the >oles node, then add it b clic6ing7dd >olesM

    B' 5f the 9eb .erver (55.) role is present, then clic6 7dd >ole .ervices and then enable the

    C45 chec6bo* under 7pplication 2evelopment groupMJ' Clic6 Ae*t and then 5nstall and #ait for the installation to complete'

  • 8/14/2019 133344830 Php Pentru Incepatori

    40/77

    Confiurin II/ to process PHP reBuests

    2o#nload and install PHP in accordance to the instructions described in manual installation steps

    &ot'+

    Aon-thread-safe build of PHP is recommended #hen using 55.' $he non-thread-safe

    builds are available at ; PHP for 9indo#s+ =inaries and .ources >eleases'Configure the C45- and astC45-specific settings inphp.)#)file as sho#n belo#+

    Example #1 C-I and )astC-I settins in php.ini

    7ast2'i.i)$*rsnat* A 17ast2'i.''in' A 02'i.7i;$at#in7A12'i.7r2*;r*+ir*2t A 0

    Configure 55. handler mapping for PHP b using either 55. %anager user interface or a commandline tool'

    Usin II/ 3anaer user interface to create a handler mappin for PHP

    ollo# these steps to create an 55. handler mapping for PHP in 55. %anager user interface+

    K' 5n the 9indo#s .tart %enu choose >un+, tpe inetmgr and clic6 36M

    E' 5n the 55. %anager user interface select the server node in the Connections tree vie#M

    B' 5n the eatures ie# page open the Handler %appings featureM

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manualhttp://windows.php.net/download/http://windows.php.net/download/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manualhttp://windows.php.net/download/
  • 8/14/2019 133344830 Php Pentru Incepatori

    41/77

    J' 5n the 7ctions pane clic6 7dd %odule %apping'''M

    O' 5n the 7dd %odule %apping dialog enter the follo#ing+

    >e@uest path+ 8'php %odule+ astCgi%odule D*ecutable+ C+^[Path to PHP installation\^php-cgi'e*e Aame+ PHPRviaRastC45

    N' Clic6 >e@uest >estrictions button and then configure the mapping to invo6e handler onlif re@uest is mapped to a file or a folderM

    Y' Clic6 3: on all the dialogs to save the configuration'

  • 8/14/2019 133344830 Php Pentru Incepatori

    42/77

  • 8/14/2019 133344830 Php Pentru Incepatori

    43/77

    optimal functionalit and performance of PHP on 55.'

    Impersonation and file s.stem access

    5t is recommended to enable astC45 impersonation in PHP #hen using 55.' $his is controlled bthe account read permission on those scripts' 5f PHP applicationsneed to perform #rite operations on certain files or #rite files into some folders then 5.> accountshould have #rite permission to those'

    $o determine #hat user account is used as an anonmous identit in 55. Y use the follo#ing

    command' >eplace the 2efault 9eb .ite #ith the name of 55. #eb site that ou use' 5n the outputt#*nti2atin

  • 8/14/2019 133344830 Php Pentru Incepatori

    44/77

  • 8/14/2019 133344830 Php Pentru Incepatori

    45/77

    Apache 1727x on 3icrosoft Windo+s$his section contains notes and hints specific to 7pache K'B'* installs of PHP on %icrosoft9indo#s sstems' $here are also instructions and notes for 7pache Eon a separate page'

    &ot'+

    Please read the manual installation stepsfirst/

    $here are t#o #as to set up PHP to #or6 #ith 7pache K'B'* on 9indo#s' 3ne is to use the C45binar (php.exefor PHP J andphpBc).exefor PHP O), the other is to use the 7pache %odule 2&&'5n either case ou need to edit our http".co#* APACHE, if ou run 7pache as a 9indo#s .ervice, or useour regular shortcuts'

    &ot'+ _ine"i minte c la adugarea cilor !n fiierele de configurare 7pache pentru9indo#s, toate bac6slash-urile cum ar fi !n c:S")rectoryS

  • 8/14/2019 133344830 Php Pentru Incepatori

    46/77

    >++T$* a$$i2atin/-#tt$+-$#$-sr2* .$#$s

    Installin as a C-I "inar.

    5f ou unzipped the PHP pac6age to C:SphpSas described in the %anual 5nstallation .tepssection,ou need to insert these lines to our 7pache configuration file to set up the C45 binar+

    Example #, PHP and Apache 1727x as C-I

    2ri$t>ias /$#$/ "2%/$#$/">++T$* a$$i2atin/-#tt$+-$#$ .$#$

    S r PHP 4>2tin a$$i2atin/-#tt$+-$#$ "/$#$/$#$.**"

    S r PHP >2tin a$$i2atin/-#tt$+-$#$ "/$#$/$#$-2'i.**"

    S s$*2i7 t#* +ir*2tr *r* $#$.ini is

    *tEn PHP(C C%/$#$

    Aote that the second line in the list above can be found in the actual versions of http".co#

  • 8/14/2019 133344830 Php Pentru Incepatori

    47/77

    #ell on 9indo#s U*, support on these platforms is incomplete, and some things #ill not #or6correctl' $here is no plan to remed this situation'

    2o#nload the most recent version of ; 7pache E'* and a fitting PHP version' ollo# the %anual5nstallation .tepsand come bac6 to go on #ith the integration of PHP and 7pache'

    $here are three #as to set up PHP to #or6 #ith 7pache E'* on 9indo#s' Fou can run PHP as a

    handler, as a C45, or under astC45'&ot'+ _ine"i minte c la adugarea cilor !n fiierele de configurare 7pache pentru9indo#s, toate bac6slash-urile cum ar fi !n c:S")rectoryS

  • 8/14/2019 133344830 Php Pentru Incepatori

    48/77

    Avertiunnin PHP under )astC-I

    >unning PHP under astC45 has a number of advantages over running it as a C45' .etting it up this#a is fairl straightfor#ard+

    3btain modRfcgid from ; http+IIhttpd'apache'orgImodRfcgidI' 9inBE binaries are available fordo#nload from that site' 5nstall the module according to the instructions that #ill come #ith it'

    Configure our #eb server as sho#n belo#, ta6ing care to adjust an paths to reflect our ho# ouhave installed things on our particular sstem+

    Example #2 Confiure Apache to run PHP as )astC-I

    La+M+* 72'i+;)+* )+*s/)+;72'i+.s

    S W#*r* is r $#$.ini 7i*2'i+InitiaEn PHP(C "2%/$#$"

    >++Han+*r 72'i+-s2ri$t .$#$2'i+Wra$$*r "2%/$#$/$#$-2'i.**" .$#$

    iles #ith a 'php e*tension #ill no# be e*ecuted b the PHP astC45 #rapper'

    /un iPlanet and &etscape servers on 3icrosoft Windo+s$his section contains notes and hints specific to .un 1ava .stem 9eb .erver, .un 3AD 9eb.erver, iPlanet and Aetscape server installs of PHP on 9indo#s'

    rom PHP J'B'B on ou can use PHP scripts #ith the A.7P5 moduleto generate custom directorlistings and error pages' 7dditional functions for 7pache compatibilit are also available' orsupport in current #eb servers read the note about subre@uests'

    C-I setup on /un iPlanet and &etscape servers

    $o install PHP as a C45 handler, do the follo#ing+

    Copphp?ts."llto our sstemroot (the director #here ou installed 9indo#s) %a6e a file association from the command line' $pe the follo#ing t#o lines+

    ass2 .$#$APHP2ri$t7t$* PHP2ri$tA2%$#$$#$.** 1

    5n the Aetscape Dnterprise 7dministration .erver create a dumm shellcgi director andremove it just after (this step creates O important lines in obj'conf and allo# the #eb serverto handle shellcgi scripts)'

    5n the Aetscape Dnterprise 7dministration .erver create a ne# mime tpe (Categor+ tpe,Content-$pe+ magnus-internalIshellcgi, ile .uffi*+php)'

    2o it for each #eb server instance ou #ant PHP to run

    %ore details about setting up PHP as a C45 e*ecutable can be found here+

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#security.cgi-binhttp://httpd.apache.org/mod_fcgid/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#ref.nsapihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.specialpageshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.specialpageshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.noteshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#security.cgi-binhttp://httpd.apache.org/mod_fcgid/http://in2.php.net/distributions/manual/php_manual_ro.html.gz#ref.nsapihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.specialpageshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.specialpageshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.sun.notes
  • 8/14/2019 133344830 Php Pentru Incepatori

    49/77

    ; http+IIbenoit'noss'free'frIphpIinstall-php'html

    &/API setup on /un iPlanet and &etscape servers

    $o install PHP #ith A.7P5, do the follo#ing+

    Copphp?ts."llto our sstemroot (the director #here ou installed 9indo#s) %a6e a file association from the command line' $pe the follo#ing t#o lines+

    ass2 .$#$APHP2ri$t7t$* PHP2ri$tA2%$#$$#$.** 1

    5n the Aetscape Dnterprise 7dministration .erver create a ne# mime tpe (Categor+ tpe,Content-$pe+ magnus-internalI*-httpd-php, ile .uffi*+ php)'

    Ddit 6a#%s.co#

  • 8/14/2019 133344830 Php Pentru Incepatori

    50/77

    $he stac6size that PHP uses depends on the configuration of the #eb server' 5f ou getcrashes #ith ver large PHP scripts, it is recommended to raise it #ith the 7dmin .erver(in the section %74A. D25$3>)'

    C-I environment and recommended modifications in php.ini

    5mportant #hen #riting PHP scripts is the fact that .un 1.9.I.un 3AD 9.IiPlanetIAetscape is amultithreaded #eb server' =ecause of that all re@uests are running in the same process space (thespace of the #eb server itself) and this space has onl one environment' 5f ou #ant to get C45variables li6ePTH_3NO,HTTP_HO+Tetc' it is not the correct #a to tr this in the old PHP #a#ith getenv()or a similar #a (register globals to environment, *_EN,)' Fou #ould onl get theenvironment of the running #eb server #ithout an valid C45 variables/

    &ot'+

    9h are there (invalid) C45 variables in the environment?

    7ns#er+ $his is because ou started the #eb server process from the admin server

    #hich runs the startup script of the #eb server, ou #anted to start, as a C45 script (aC45 script inside of the admin server/)' $his is #h the environment of the started #ebserver has some C45 environment variables in it' Fou can test this b starting the #ebserver not from the administration server' se the command line as root user and start itmanuall - ou #ill see there are no C45-li6e environment variables'

    .impl change our scripts to get C45 variables in the correct #a for PHP J'* b using thesuperglobal*_+ER,ER' 5f ou have older scripts #hich use *HTTP_HO+T, etc', ou should turn onre)ster_lo$alsinphp.)#)and change the variable order too (important+ remove LELfrom it,because ou do not need the environment here)+

    aria*s;r+*r A "?PC"

    r*'ist*r;'as A On

    /pecial use for error paes or self!made director. listins 0PHP @; =7272

    Fou can use PHP to generate the error pages for L?? Not o%#"Lor similar' 7dd the follo#ing lineto the object in o$K.co#5 are in the variables*_+ER,ER-PTH_3NOand *_+ER,ER-PTH_TRN+;TED'

    &ote a"out nsapivirtual0and su"reBuests 0PHP @; =7272

    $he A.7P5 module no# supports the nsapiRvirtual()function (alias+ virtual()) to ma6e subre@uests

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.getenvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.nsapi-virtualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.nsapi-virtualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.virtualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.getenvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#reserved.variables.serverhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.nsapi-virtualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.nsapi-virtualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#function.virtual
  • 8/14/2019 133344830 Php Pentru Incepatori

    51/77

  • 8/14/2019 133344830 Php Pentru Incepatori

    52/77

  • 8/14/2019 133344830 Php Pentru Incepatori

    53/77

    %an e*tensions are $%)lt )#tothe 9indo#s version of PHP' $his means additional 2&& files, andthe e*tensiondirective, are #otused to load these e*tensions' $he 9indo#s PHP D*tensionstablelists e*tensions that re@uire, or used to re@uire, additional PHP 2&& files' HereGs a list of built ine*tensions+

    5n PHP J (updated PHP J'B'KK)+ =C%ath, Caledar,C3%, Ctpe,$P, %.&,32=C, 3verload,PC>D, .ession,$o6enizer,922&, Client >& librarfunctions

    >e@uires+ l)$eay2."ll, ssleay2."ll(bundled)

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#ini.extensionhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.extensions.overviewhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.calendarhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.comhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.comhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ctypehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.uodbchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.uodbchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pcrehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sessionhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.wddxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.zlibhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.zlibhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.domhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.domhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.libxmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.iconvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.iconvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.simplexmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.splhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.splhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sqlitehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#ini.extension-dirhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bzip2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.peclhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.peclhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.peclhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.pecl.downloadshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bzip2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bzip2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.calendarhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.crackhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.crackhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ctypehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.curlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#ini.extensionhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.extensions.overviewhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.calendarhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.comhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ctypehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.uodbchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pcrehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sessionhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.wddxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.zlibhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.domhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.libxmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.iconvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.simplexmlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.splhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sqlitehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#ini.extension-dirhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bzip2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.peclhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.peclhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.pecl.downloadshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.bzip2http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.calendarhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.crackhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ctypehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.curl
  • 8/14/2019 133344830 Php Pentru Incepatori

    54/77

    Extension 4escription &otes

    phpRdba'dll2=7+ 2ata=ase (dbm-stle)7bstraction laer functions

    Aone

    phpRdbase'dll d=asefunctions Aone

    phpRdb*'dll db*functions

    phpRdom*ml'dll PHP J dom*ml functions PHP TW J'E'L re@uires+ l)$x6l2."ll(bundled) PHPVW J'B'L re@uires+ )co#."ll(bundled)

    phpRdotnet'dll 'AD$functions PHP TW J'K'K

    phpRe*if'dll De@uires+ e@uires+ )co#B1.."ll(bundled), PHP VWJ'E'K)co#."ll

    phpRif*'dll 5nformi*functions >e@uires+ 5nformi* libraries

    phpRiisfunc'dll 55. management functions Aone

    phpRimap'dll5%7PP3PB and AA$Pfunctions

    Aone

    phpRingres'dll 5ngresfunctions >e@uires+ 5ngres libraries

    phpRinterbase'dll 5nter=asefunctions >e@uires+ "s2."ll(bundled)

    phpRjava'dll 1avafunctions PHP TW J'L'N re@uires+K6."ll(bundled)

    phpRldap'dll &27Pfunctions

    PHP TW J'E'L re@uires l)$sasl."ll(bundled), PHP

    VW J'B'L re@uires l)$eay2."ll, ssleay2."ll(bundled)

    phpRmbstring'dll %ulti-=te .tringfunctions Aone

    phpRmcrpt'dll %crpt Dncrptionfunctions >e@uires+ l)$6crypt."ll

    phpRmhash'dll %hashfunctions PHP VW J'B'L re@uires+ l)$6hash."ll(bundled)

    phpRmimeRmagic'dll

    %imetpefunctions >e@uires+ 6a)c.6)6e(bundled)

    phpRming'dll %ingfunctions for lash Aone

    phpRms@l'dll m.&functions >e@uires+ 6sAl."ll(bundled)

    phpRmss@l'dll %..&functions >e@uires+ #t="$l)$."ll(bundled)phpRms@l'dll %.&functions PHP VW O'L'L, re@uires l)$6ysAl."ll(bundled)

    phpRms@li'dll %.&ifunctions PHP VW O'L'L, re@uires l)$6ysAl."ll(l)$6ysAl)."llin

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbahttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dotnethttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.exifhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.exifhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mbstringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fbsqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fdfhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fileprohttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fileprohttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imagehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imagehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.gettexthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.hwhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.iconvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ifxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ifxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ingreshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ibasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.javahttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ldaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mbstringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mbstringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mcrypthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mcrypthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mhashhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mhashhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mime-magichttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.minghttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.msqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mssqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbahttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dbxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.dotnethttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.exifhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mbstringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fbsqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fdfhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.fileprohttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ftphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imagehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imagehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.gettexthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.hwhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.iconvhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ifxhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.imaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ingreshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ibasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.javahttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ldaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mbstringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mcrypthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mhashhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mime-magichttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.minghttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.msqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mssqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.mysqli
  • 8/14/2019 133344830 Php Pentru Incepatori

    55/77

    Extension 4escription &otes

    PHP TW O'L'E) (bundled)

    phpRociX'dll 3racle Xfunctions >e@uires+ 3racle X'KS client libraries

    phpRopenssl'dll 3pen..&functions >e@uires+ l)$eay2."ll(bundled)

    phpRoverload'dllPHP J 3bject overloading

    functions

    =uilt in since PHP J'B'L, removed as of PHP O'L'L

    phpRpdf'dll P2functions Aone

    phpRpgs@l'dll Postgre.&functions Aone

    phpRprinter'dll Printerfunctions Aone

    phpRshmop'dll .hared %emorfunctions Aone

    phpRsnmp'dll.A%Pget and #al6functions

    A$ onl/

    phpRsoap'dll .37Pfunctions PHP VW O'L'L

    phpRsoc6ets'dll .oc6etfunctions Aone

    phpRsbaseRct'dll .basefunctions >e@uires+ .base client libraries

    phpRtid'dll $idfunctions PHP VW O'L'L

    phpRto6enizer'dll $o6enizerfunctions =uilt in since PHP J'B'L

    phpR#BEapi'dll 9BEapifunctions Aone

    phpR*mlrpc'dll PCfunctions PHP VW J'E'K re@uires+ )co#."ll(bundled)

    phpR*slt'dll ead onl accessphpRzlib'dll Z&ibcompression functions =uilt in since PHP J'B'L

    Command (ine PHP on 3icrosoft Windo+s$his section contains notes and hints specific to getting PHP running from the command line for9indo#s'

    &ot'+

    Fou should read the manual installation stepsfirst/

    4etting PHP to run from the command line can be performed #ithout ma6ing an changes to9indo#s'

    C%PHP$#$.** -7 "C%PHP 2ri$tss2ri$t.$#$" -- -ar'1 -ar'G -ar'3

    =ut there are some eas steps that can be follo#ed to ma6e this simpler' .ome of these steps shouldalread have been ta6en, but are repeated here to be able to provide a complete step-b-stepse@uence'

    &ot'+

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.oci8http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.opensslhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.opensslhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pdfhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pgsqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pgsqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.printerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.printerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.shmophttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.shmophttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.snmphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.snmphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.soaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.soaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.socketshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.socketshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sybasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tidyhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.w32apihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xmlrpchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xslthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.yazhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ziphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.zlibhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manualhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.oci8http://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.opensslhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pdfhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.pgsqlhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.printerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.shmophttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.snmphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.soaphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.socketshttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.sybasehttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tidyhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.tokenizerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.w32apihttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xmlrpchttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.xslthttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.yazhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.ziphttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#book.zlibhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#install.windows.manual
  • 8/14/2019 133344830 Php Pentru Incepatori

    56/77

    =othPTHandPTHETare important pre-e*isting sstem variables in9indo#s, and care should be ta6en to not over#rite either variable, onl to addto them'

    7ppend the location of the PHP e*ecutable (php.exe,phpB=)#.exeorphpBcl).exedependingupon our PHP version and displa preferences) to thePTHenvironment variable' >eadmore about ho# to add our PHP director toPTHin the corresponding 7 entr'

    7ppend the .PHPe*tension to thePTHETenvironment variable' $his can be done at thesame time as amending thePTHenvironment variable' ollo# the same steps as describedin the 7but amend thePTHETenvironment variable rather than thePTHenvironment variable'

    &ot'+

    $he position in #hich ou place the .PHP#ill determine #hich script orprogram is e*ecuted #hen there are matching filenames' or e*ample, placing.PHPbefore .IT#ill cause our script to run, rather than the batch file, if there

    is a batch file #ith the same name' 7ssociate the .PHPe*tension #ith a file tpe' $his is done b running the follo#ing

    command+

    ass2 .$#$A$#$7i*

    7ssociate thephpL;M>CHIEOTW>(ECass*s.$#$@]A"$#$7i*""Cnt*nt T$*"A"a$$i2atin/$#$"

    =H\EY;LOC>L;M>CHIEOTW>(ECass*s$#$7i*@]A"PHP 2ri$t""E+ita's"A+&r+%00000000"Br&s*ra's"A+&r+%0000000">&as#&Et"A""

    =H\EY;LOC>L;M>CHIEOTW>(ECass*s$#$7i*D*7atI2n@]A"C%PHP$#$-&in.**0"

    =H\EY;LOC>L;M>CHIEOTW>(ECass*s$#$7i*s#*@]A"O$*n"

    =H\EY;LOC>L;M>CHIEOTW>(ECass*s$#$7i*s#*O$*n@

    ]A"XO$*n"

    =H\EY;LOC>L;M>CHIEOTW>(ECass*s$#$7i*s#*O$*n2))an+@]A""C%PHP$#$.**" -7 "1" -- [G"

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopathhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#faq.installation.addtopath
  • 8/14/2019 133344830 Php Pentru Incepatori

    57/77

    9ith these changes the same command can be #ritten as+

    "C%PHP 2ri$tss2ri$t" -ar'1 -ar'G -ar'3

    or, if our LC:SPHP +cr)ptsLpath is in thePTHenvironment variable+

    s2ri$t -ar'1 -ar'G -ar'3

    &ot'+

    $here is a small problem if ou intend to use this techni@ue and use our PHP scripts asa command line filter, li6e the e*ample belo#+

    +ir R "C%PHP 2ri$tss2ri$t" -ar'1 -ar'G -ar'3

    or

    +ir R s2ri$t -ar'1 -ar'G -ar'3

    Fou ma find that the script simpl hangs and nothing is output' $o get this operational,ou need to ma6e another registr change'

    Win+&s (*'istr E+itr *rsin .00

    =H\EY;LOC>L;M>CHIEOTW>(EMi2rs7tWin+&sCrr*nt*rsin$i2i*sE$r*r@"In#*ritCns*Han+*s"A+&r+%00000001

    urther information regarding this issue can be found in this ; %icrosoft:no#ledgebase 7rticle + BEKYXX'

    Installation on Cloud Computin platforms

    Cuprins

    %icrosoft 7zure 7mazon DCE

    PHP installs on the cloud' $o the PHP cloud/

    3icrosoft A

  • 8/14/2019 133344830 Php Pentru Incepatori

    58/77

    Ama

  • 8/14/2019 133344830 Php Pentru Incepatori

    59/77

    Confiuration

    P% usesphp.)#)snta* for its configuration file -phpB

  • 8/14/2019 133344830 Php Pentru Incepatori

    60/77

    .et listen(E) bac6log' 7 value of G-KG means unlimited' 2efault value+ -K'

    listen.allowed_clientsstring

    &ist of ipvJ addresses of astC45 clients #hich are allo#ed to connect' D@uivalent to theC45R9D=R.D>D>R722>. environment variable in the original PHP astC45 (O'E'ES)'%a6es sense onl #ith a tcp listening soc6et' Dach address must be separated b a comma' 5fthis value is left blan6, connections #ill be accepted from an ip address' 2efault value+ an'

    listen.ownerstring

    .et permissions for uni* soc6et, if one is used' 5n &inu*, readI#rite permissions must be set inorder to allo# connections from a #eb server' %an =.2-derived sstems allo# connectionsregardless of permissions' 2efault values+ user and group are set as the running user, mode isset to LNNN'

    listen.groupstring

    .ee l)ste#.o=#er'listen.modestring

    .ee l)ste#.o=#er'

    userstring

    ni* user of P% processes' $his option is mandator'

    groupstring

    ni* group of P% processes' 5f not set, the default userGs group is used'

    pmstring

    Choose ho# the process manager #ill control the number of child processes' Possible values+stat)c, o#"e6a#", "y#a6)c' $his option is mandator'

    stat)c- the number of child processes is fi*ed (p6.6ax_ch)l"re#)'

    o#"e6a#"- the processes spa#n on demand (#hen re@uested, as opposed to dnamic, #herep6.start_serersare started #hen the service is started'

    "y#a6)c- the number of child processes is set dnamicall based on the follo#ing directives+p6.6ax_ch)l"re#,p6.start_serers,p6.6)#_spare_serers,p6.6ax_spare_serers'

    pm.max_childrenint

    $he number of child processes to be created #henp6is set to stat)cand the ma*imumnumber of child processes to be created #henp6is set to "y#a6)c' $his option is mandator'

    $his option sets the limit on the number of simultaneous re@uests that #ill be served'D@uivalent to the 7pache%a*Clients directive #ith mpmRprefor6 and to the

    PHP_C03_CH3;DRENenvironment variable in the original PHP astC45'

    pm.start_serversin

    $he number of child processes created on startup' sed onl #henp6is set to "y#a6)c'2efault alue+ minRspareRservers S (ma*RspareRservers - minRspareRservers) I E'

    pm.min_spare_serversint

    http://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.integerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.integerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.stringhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.integerhttp://in2.php.net/distributions/manual/php_manual_ro.html.gz#language.types.integer
  • 8/14/2019 133344830 Php Pentru Incepatori

    61/77

    $he desired minimum number of idle server processes' sed onl #henp6is set to "y#a6)c'7lso mandator in this case'

    pm.max_spare_serversint

    $he desired ma*imum number of idle server processes' sed onl #henp6is set to "y#a6)c'7lso mandator in this case'

    pm.max_requestsint

    $he number of re@uests each child process should e*ecute before respa#ning' $his can beuseful to #or6 around memor lea6s in Brd part libraries' or endless re@uest processingspecif GLG' D@uivalent toPHP_C03_M_RE8UE+T+' 2efault value+ L'

    pm.status_pathstring

    $he >5 to vie# the P% status page' 5f this value is not set, no >5 #ill be recognized as astatus page' 2efault value+ none'

    ping.pathstring

    $he ping >5 to call the monitoring page of P%' 5f this value is not set, no >5 #ill berecognized as a ping page' $his could be used to test from outside that P% is alive andresponding' Please note that the value must start #ith a leading slash (I)'

    ping.responsestring

    $his directive ma be used to customize the response to a ping re@uest' $he response isformatted as te*tIplain #ith a ELL response code' 2efault value+ pong'

    request_terminate_timeoutmi*ed

    $he timeout for serving a single re@uest after #hich the #or6er process #ill be 6illed' $hisoption should be used #hen the Gma*Re*ecutionRtimeG ini option does not stop scripte*ecution for some reason' 7 value of GLG means G3ffG' 7vailable units+ s(econds)(default),m(inutes), h(ours), or d(as)' 2efault value+ L'

    request_slowlog_timeoutmi*ed

    $he timeout for serving a single re@uest after #hich a PHP bac6trace #ill be dumped to theGslo#logG file' 7 value of GLG means G3ffG' 7vailable units+ s(econds)(default), m(inutes),h(ours), or d(as)' 2efault value+ L'

    slowlogstring

    $he log file for slo# re@uests' 2efault value+ 3N+T;;_PRE3/lo/phpB

  • 8/14/2019 133344830 Php Pentru Incepatori

    62/77

    Chroot to this director at the start' $his value must be defined as an absolute path' 9hen thisvalue is not set, chroot is not used'

    chdirstring

    Chdir to this director at the start' $his value must be an absolute path' 2efault value+ currentdirector or I #hen chroot'

    catch_workers_outputboolean

    >edirect #or6er stdout and stderr into main error log' 5f not set, stdout and stderr #ill beredirected to IdevInull according to astC45 specs' 2efault value+ no'

    5tGs possible to pass additional environment variables and update PHP settings of a certain pool' $odo this, ou need to add the follo#ing options tophpB

  • 8/14/2019 133344830 Php Pentru Incepatori

    63/77

    Installation of PEC( extensions

    Cuprins

    5ntroduction to PDC& 5nstallations 2o#nloading PDC& e*tensions 5nstalling a PHP e*tension on 9indo#s Compiling shared PDC& e*tensions #ith the pecl command Compiling shared PDC& e*tensions #ith phpize php-config Compiling PDC& e*tensions staticall into PHP

    Introduction to PEC( Installations; PDC& is a repositor of PHP e*tensions that are made available to ou via the ; PD7> pac6agingsstem' $his section of the manual is intended to demonstrate ho# to obtain and install PDC&e*tensions'

    $hese instructions assume/yo%r/phpsrc")r/is the path to the PHP source distribution, and thatext#a6eis the name of the PDC& e*tension' 7djust accordingl' $hese instructions also assume afamiliarit #ith the ; pear command'$he information in the PD7> manual for thepearcommandalso applies to thepeclcommand'

    $o be useful, a shared


Recommended