Anda di halaman 1dari 9

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

/
Focussearchbox
Apache1.3.xenMicrosoftWindows
MicrosoftIIS5.1yIIS6.0
ManualdePHP
Instalacinyconfiguracin
InstalacinensistemasWindows
Changelanguage: Spanish
EditReportaBug

MicrosoftIIS7.0yposteriores
EstaseccincontieneinstruccionesparaconfigurarenformamanualInternetInformationServices(IIS)7.0y
posterioresparatrabajarconPHPenMicrosoftWindowsVistaSP1,Windows7,WindowsServer2008and
WindowsServer2008R2.ParaobtenerinstruccionessobrelaconfiguracindeIIS5.1andIIS6.0onWindows
XPandWindowsServer2003refiraseaMicrosoftIIS5.1andIIS6.0.

HabilitacindeapoyoFastCGIenIIS
MduloFastCGIestdeshabilitadoenlainstalacinpordefectodeIIS.Lospasosparaquepuedavariarsegnla
versindeWindowsseestutilizando.
ParaactivarelsoporteFastCGIenWindowsVistaSP1yWindows7:
1. EnelmenudeiniciodeWindowsseleccione"Run:",teclee"optionalfeatures.exe"yclick"Ok"
2. Enel"WindowsFeatures"cuadrodedilogo"InternetInformationServices","WorldWideWebServices",
"CaracteristicasDesarrollodeaplicaciones"yluegopermitirqueel"CGI"checkbox
3. HagaclicenAceptaryesperehastaquesecompletelainstalacin

http://php.net/manual/es/install.windows.iis7.php

3/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

ParaactivarelsoporteFastCGIenWindowsServer2008yWindowsServer2008R2:
1. EnelmenIniciodeWindowselegir"Run:",teclee"CompMgmtLauncher"yclick"Ok"
2. Enel"WebServer(IIS)"Elrolnoestpresenteenelmarcodel"Roles"nodo,acontinuacin,aadir
haciendoclicen"AdicionarRoles"
3. Sila"WebServer(IIS)"roleestapresente,entonceshagaclick"AddRoleServices"yluegopermitirqueel
"CGI"casilladeverificacinengrupo"DesarrollodeAplicaciones"
4. Click"Next"yluego"Install"ayespereaquelainstalacinsecomplete.

http://php.net/manual/es/install.windows.iis7.php

4/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

ConfigurarIISparaprocesarlassolicitudesdePHP
DescargueeinstalePHPdeacuerdoalasinstruccionesdescritasenmanualinstallationsteps
Nota:
NoconstruirthreadsafedePHPserecomiendacuandoIISutilizando.Elnothreadsafecreaestn
disponiblesenPHPparaWindows:binariosyfuentes.
ConfigureelCGIylaconfiguracinespecficadeFastCGIphp.inificherocomosemuestraacontinuacin:
Ejemplo#1CGIyFastCGIenlaconfiguracinphp.ini
fastcgi.impersonate=1
fastcgi.logging=0
cgi.fix_pathinfo=1
cgi.force_redirect=0

ConfigurarlaasignacindeIIScontroladorparaPHPutilizandolainterfazdeusuarioAdministradordeIISouna
herramientadelneadecomandos.
ElusodeIISinterfazdeusuariodeManagerparacrearunaasignacindecontroladorparaPHP
SigaestospasosparacrearunaasignacindecontroladordeIISparaPHPenlainterfazdeusuarioAdministrador
deIIS:
1. EnelmenIniciodeWindowselegir"Run:",escriba"inetmgr"yclick"Ok"
2. EnlainterfazdeusuariodeIISManager,seleccioneelnododeservidorenel"Connections"vistaderbol
3. Enel"Caractersticas"Pginadeabrirel"HandlerMappings"feature
http://php.net/manual/es/install.windows.iis7.php

5/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

4. Enel"Actions"hagaclickenpanel"AddModuleMapping..."
5. Enel"AddModuleMapping"dilogoentrelosiguiente:
Solicitudderuta:*.php
Modulo:FastCgiModule
Ejecutable:C:\[PathtoPHPinstallation]\phpcgi.exe
Nombre:PHP_via_FastCGI
6. HagaClicken"SolicitarRestricciones"botnyluegoconfigurarlaasignacindeinvocarcontroladorslosi
lasolicitudseasignaaunarchivoounacarpeta
7. HagaclicenAceptarentodosloscuadrosdedilogoparaguardarlaconfiguracin.

http://php.net/manual/es/install.windows.iis7.php

6/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

UtilizandolaherramientadelneadecomandosparacrearunaasignacindecontroladorparaPHP
UtiliceelcomandomostradoacontinuacinparacrearungrupodeIISFastCGIprocesoqueutilizarphpcgi.exe
ejecutableparalatramitacindesolicitudesdePHP.VuelvaacolocarelvalordelparmetrofullPathconlaruta
absolutaalficherophpcgi.exe.
Ejemplo#2>CreacindelprocesodelgrupoIISFastCGI
%windir%\system32\inetsrv\appcmdsetconfig/section:system.webServer/fastCGI^
/+[fullPath='c:\PHP\phpcgi.exe']

ConfigurarIISPHPparamanejarlaspeticionesconcretasdelaejecucindelcomandoquesemuestraa
continuacin.VuelvaacolocarelvalordelparmetroscriptProcessorconlarutadeaccesoabsolutaalfichero
phpcgi.exe.
Ejemplo#3CreacindemapasmanejadordepeticionesPHP
%windir%\system32\inetsrv\appcmdsetconfig/section:system.webServer/handlers^
/+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',^
scriptProcessor='c:\PHP\phpcgi.exe',resourceType='Either']

EstecomandocreaunaasignacindecontroladordeIISparalaextensindearchivo*.php,loqueresultaren
todaslasdireccionesURLqueterminancon.PhpsiendomanejadoporelmduloFastCGI.
Nota:
http://php.net/manual/es/install.windows.iis7.php

7/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

Enestepuntolanecesidaddeinstalacinyconfiguracindelospasossehancompletado.Las
instruccionesacontinuacinsonopcionales,peroaltamenterecomendableparalograruna
funcionalidadptimayelrendimientodePHPenIIS.

Suplantacindeidentidadyaccesoaarchivosdelsistema
SerecomiendahabilitarlasuplantacinenPHPFastCGIcuandoIISutilizando.Estaestcontroladoporla
directivafastcgi.impersonateenelficherophp.ini.Cuandoesthabilitadalasuplantacin,PHPrealizartodaslas
operacionesdelsistemadeficherosennombredelacuentadeusuarioquehasidodeterminadoporla
autentificacindeIIS.Estoaseguraque,aunqueelprocesomismoPHPescompartidoatravsdediferentessitios
webIIS,losscriptsPHPenlossitioswebnosercapazdeaccederalosdemsficheros,siempreycuandolas
cuentasdeusuarioseutilizanparalaautenticacindeIISencadasitioweb.
PorejemploIIS7,ensuconfiguracinpordefecto,sehahabilitadolaautenticacinannimaconincorporada
IUSRcuentadeusuarioutilizadacomounaidentidadpordefecto.EstosignificaqueparaqueIISejecutarscripts
PHP,esnecesarioconcederalacuentaIUSRpermisodelecturaenestosscripts.SilasaplicacionesPHPnecesidad
derealizaroperacionesdeescrituradeciertosficherosoescribirficherosenunacarpetasentoncescuentaIUSR
debetenerpermisoparaescribirenellos.
ParadeterminarqucuentadeusuarioseutilizacomounaidentidadannimaenIIS7utiliceelsiguientecomando.
Vuelvaacolocarel"SitioWebpredeterminado"conelnombredelsitioWebdeIISqueutiliza.Enlaproduccin
configuracinXMLaspectodeelementoparaelatributouserName.
Ejemplo#4LadeterminacindelacuentautilizadacomoIISidentidadannima
%windir%\system32\inetsrv\appcmd.exelistconfig"DefaultWebSite"^
/section:anonymousAuthentication
<system.webServer>
<security>
<authentication>
<anonymousAuthenticationenabled="true"userName="IUSR"/>
</authentication>
</security>
</system.webServer>

Nota:
SielatributouserNamenoestpresenteenelelementoanonymousAuthentication,osiseestablece
unacadenavaca,entoncessignificaquelaidentidaddelgrupodeaplicacionesseutilizacomoun
identidadannimaparaesesitioweb.
Paramodificarlaconfiguracindepermisosdearchivosycarpetas,utilicelainterfazdeusuariodelExploradorde
Windowsocomandoicacls.
Ejemplo#5Configuracindearchivodelospermisosdeacceso
icaclsC:\inetpub\wwwroot\upload/grantIUSR:(OI)(CI)(M)

Establecerindex.phpcomoundocumentopredeterminadoenIIS
LosdocumentospordefectodeIISseutilizanparalassolicitudesHTTPquenoseespecificaunnombrede
documento.ConlasaplicacionesPHP,index.phpporlogeneralactacomoundocumentopredeterminado.Para
aadirindex.phpalalistadelosdocumentospordefectodeIIS,utiliceestecomando:
Ejemplo#6Establecerindex.phpcomoundocumentopredeterminadoenIIS
http://php.net/manual/es/install.windows.iis7.php

8/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

%windir%\system32\inetsrv\appcmd.exesetconfig^
section:system.webServer/defaultDocument/+"files.[value='index.php']"^
/commit:apphost

FastCGIyconfiguracindePHPReciclaje
ConfigurarlaconfiguracindeIISFastCGIPHPparaelreciclajedelosprocesosmedianteloscomandosdeabajo.
LaconfiguracinFastCGIinstanceMaxRequestscontrolacuntaspeticionesseprocesadoporunsolopeocesophp
cgi.exeantesdeIISsecierra.LavariabledeentornoPHPPHP_FCGI_MAX_REQUESTScontrolaelnmeropide
unasolaprocesophpcgi.exeseencargarantesdequesereciclasmisma.Asegresedequeelvalorespecificado
paralaconfiguracinFastCGIInstanceMaxRequestsesmenoroigualalvalorespecificadopara
PHP_FCGI_MAX_REQUESTS.
Ejemplo#7ConfiguracindePHPFastCGIyelreciclaje
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/fastCgi^
/[fullPath='c:\php\phpcgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/fastCgi^
/+"[fullPath='C:\{php_folder}\phpcgi.exe'].environmentVariables.^
[name='PHP_FCGI_MAX_REQUESTS',value='10000']"

FastCGIajustesdetiempodeespera
AumentareltiempodeesperaparalaconfiguracindeFastCGIsiseesperateneralargoejecutarscriptsPHP.Los
dosvaloresquelostiemposdeesperadecontrolactivityTimeoutyrequestTimeout.Utiliceloscomandossiguientes
paracambiarlaconfiguracindetiempodeespera.AsegresedesustituirelvalorenelparmetroafullPath
contendrlarutaabsolutaaelficherophpcgi.exe.
Ejemplo#8ConfiguracindelosajustesdetiempodeesperaFastCGI
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/fastCgi^
/[fullPath='C:\php\phpcgi.exe',arguments=''].activityTimeout:"90"/commit:apphost
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/fastCgi^
/[fullPath='C:\php\phpcgi.exe',arguments=''].requestTimeout:"90"/commit:apphost

Cambiarlaubicacindelficherophp.ini
PHPbuscaelficherophp.inienvarioslugaresyesposiblecambiarlasubicacionespredeterminadasdelfichero
php.iniutilizandovariabledeentornoPHPRC.EncomendaraPHPparacargarelarchivodeconfiguracindesde
unaubicacinpersonalizada,ejecuteelcomandosemuestraacontinuacin.Larutadeaccesoabsolutaal
directorioconelficherophp.inidebeserespecificacomounvalordevariabledeentornoPHPRC.
Ejemplo#9Cambiarlaubicacindelficherophp.ini
appcmd.exesetconfigsection:system.webServer/fastCgi^
/+"[fullPath='C:\php\php.exe',arguments=''].environmentVariables.^
[name='PHPRC',value='C:\Some\Directory\']"/commit:apphost

addanote

UserContributedNotes13notes
up
down
http://php.net/manual/es/install.windows.iis7.php

9/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

20
Aditya
2yearsago
Toresolvetheerror"TheFastCGIprocessexitedunexpectedly"installthebelowpackage:
TofixitIhadtoinstalltheVisualC++RedistributableforVisualStudio2012Update3
http://www.microsoft.com/enus/download/confirmation.aspx?id=30679

up
down
9
sedativchunkatgmaildotcom
9monthsago
Thismightbeanincrediblystupidcomment,butIthoughtIwouldshareanyway.Ifyouwanttoinstall
PHPonWindowsServerinoneclickwithoutallthehassleabove,simplygoheretotheofficialIIS
website:
http://php.iis.net
Runtheinstall,boom,PHPworksonyourIIS/Windowsserver!Nocommandpromptwindows,nomessingwith
settings,everythingispreconfigured.IfollowedallthestepsonthispageandIcouldnotgetPHP
workingforanything.WhenIwasabouttogiveup,IfoundthatlinkwheretheofficialMicrosoft
installermadeitstupidlyeasy.
Useit,saveyourtimeandgetbacktoworkfaster.

up
down
5
matteodotalvazziatgmaildotcom
1yearago
It'sabitsilly,butit'sworthwritingitdown,astherewillbeadayyou'llhavetoconfigurephp
onIISinaPreproductionviaVPNwithareallypushingcustomerandonlyfewminutesavailable...and
somehowyouWILLforgetthis.
Php.inibydefaulthastheshortcodesettooff,soifyouconfigureeverythingandtestitoutwith
<?phpinfo()?>youwillablankscreenwiththecodeinthesource,whichcanalsoindicatethatthere
issomethingwrongintheconfigurationandthatthescriptdoesn'tgetsenttothephpprocessor.It's
not,it'scorrect!Justtestoutwith<?phpphpinfo();?>orturnontheshortcodes!

up
down
0
jbtibor
4monthsago
MicrosoftWebPlatformInstallerforphpMySQLandothers:
http://www.microsoft.com/web/downloads/platform.aspx

up
down
0
BradfordPlummer
2yearsago
IfyougetanerrorrunningthesecondcommandinExample7trythisinstead:
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/fastCgi/+"
[fullPath='C:\php\phpcgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']"
Besuretochangethepathtothephpcgi.exefileifitisnotatC:\php\.
http://php.net/manual/es/install.windows.iis7.php

10/13

9/11/2015

PHP:MicrosoftIIS7.0yposterioresManual

Goodluck.

up
down
0
NG
3yearsago
Example#9failsunlessIchange"php.exe"to"phpcgi.exe"asfollows:
appcmd.exesetconfigsection:system.webServer/fastCgi^
/+"[fullPath='C:\php\phpcgi.exe',arguments=''].environmentVariables.^
[name='PHPRC',value='C:\PHP\']"/commit:apphost

up
down
3
brrg58atyahoodotcom
1yearago
FollowingtheinstallationstepssecondlineofExample#3resultedinanerror:
ERROR(message:CannotfindSITEobjectwithidentifier
"path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='(pathtoPHP)\php
cgi.exe',resourceType='Either']".)
Apparentlythereisanextraspacebeforethe,path='*.php'thatmustberemoved.
Thanks

up
down
5
BEdge(MScertifiedTrainer)
1yearago
Excellentnotesthelastcommentaboutaddingtheenvironmentvariablesworksaspreviouslystatedfor
bothexamples.Ihadtofigureitoutbeforereadingthesecomments...
andyesthecorrectformatwouldbe
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/FastCGI^/+"
[fullPath='c:\PHP\phpcgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']"
andforthesecondone
%windir%\system32\inetsrv\appcmd.exesetconfigsection:system.webServer/FastCGI^/+"
[fullPath='c:\PHP\phpcgi.exe'].environmentVariables.[name='PHPRC',value='c:\PHP\']"
hopethishelped!

up
down
7
mdotbenettatgmaildotcom
2yearsago
InCGIandFastCGIsettingsinphp.iniexaple,add:
extension_dir='ext'

up
down
8
mfuhrmanatenetarchdotnet
http://php.net/manual/es/install.windows.iis7.php

11/13

Anda mungkin juga menyukai