I have installed php5.x.x to work with IIS7
I am using dreamweaver 8 to run a simple php page.
I cannot view the page. (just a
page)PHP Code:
Echo "Hello World";
How do I configure IIS7 and Php?
I have installed php5.x.x to work with IIS7
I am using dreamweaver 8 to run a simple php page.
I cannot view the page. (just a
page)PHP Code:
Echo "Hello World";
How do I configure IIS7 and Php?
|--- www.RealJamaicaEstate.com ™ ---|
Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
--- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com ™
I have 2 questions?
1) Are you able to access other pages through your localhost?
2) Did you install php 5.x.x.x "CGI only" and not the "API"
Answers
1) localhost is accessibile
2) php 5.2.3 IIS CGI
I am going to try add php extension in MIME with MIME Type = application/octet-streamHTTP Error 404.3 - Not Found
Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.
Error Code: 0x80070032
Notification: ExecuteRequestHandler
Module: StaticFileModule
Requested URL: http://localhost:80/test1.php
Physical Path: C:\inetpub\wwwroot\test1.php
Logon User: Anonymous
Logon Method: Anonymous
Handler: StaticFile
but let I google it first.
Last edited by Utech22; Jun 14, 2007 at 02:06 PM. Reason: error msg
|--- www.RealJamaicaEstate.com ™ ---|
Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
--- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com ™
A couple of months ago, I wrote a quick and dirty entry on how to install PHP on IIS7. The main purpose of that entry was to explain the details of what was going on as well as cookie-cutter instructions of one way to successfully install PHP on IIS7.
Well, the responses that I have received from that blog entry made me realize that I need to provide something a little more shrink-wapped which does a few more things other than just run the bare minimum... because I was seeing way too many broken custom modifications coming from mistaken assumptions about PHP or IIS7.
Here it is, V2. Just copy/paste the following into a .bat file, right-click run it as elevated Administrator on Vista, and follow the prompted instructions. You should have PHP extracted into a directory of your choice before-hand (I favor and default to %SYSTEMDRIVE%\Inetpub\PHP for many aforementioned reasons; in my examples, I chose "C:\Program Files\P H P" to show it working with long pathnames).
The batch script:
* Works with PHP installed wherever, including pathnames with spaces. Just tell it where you installed PHP (sans double quotes and trailing backslash)
* Gives choice of whether to use the CGI or ISAPI version of PHP. You do have to give the correct binary name (php5isapi.dll or php-cgi.exe, assuming PHP5), but there are checks for that
* Gives warnings and errors if the directory/file does not exist, mismatched binary types, and additional steps you need to do to have a minimally functioning PHP
Now, I am no PHP expert, so I can only give instructions for how to get PHP configured and running on IIS7. Questions about all other PHP-related features (like PHP extensions, integration with mySQL, etc) and how to get them working really belong on a PHP support forum.
Sample Execution Results:
* Setting up PHP5 installed at "C:\Program Files\P H P", ISAPI version. Notice the defaults and verification of provided inputs.
David.Wang's Sample PHP/IIS7 Configurator
Version: June 2006
------------------------------ Summary ------------------------------
PHP Binaries Dir : C:\Inetpub\PHP
PHP Binary Type : ISAPI
PHP Binary Name : php5isapi.dll
---------------------------------------------------------------------
Validating inputs...
ERROR: PHP Binary "C:\Inetpub\PHP\php5isapi.dll" does not exist!
Please first completely extract PHP to "C:\Inetpub\PHP"
Remember to tweak PHP.INI for security and functionality per php.net
Finished input validation.
Press 1 to EDIT choices, or ENTER to start IIS modifications:1
Press ENTER to accept [C:\Inetpub\PHP], or provide new value (folder path)
PHP Binaries Dir:C:\Program Files\P H P
Press ENTER to accept [ISAPI], or provide new value (CGI or ISAPI)
PHP Binary Type:
Press ENTER to accept [php5isapi.dll], or provide new value (filename)
PHP Binary Name:
David.Wang's Sample PHP/IIS7 Configurator
Version: June 2006
------------------------------ Summary ------------------------------
PHP Binaries Dir : C:\Program Files\P H P
PHP Binary Type : ISAPI
PHP Binary Name : php5isapi.dll
---------------------------------------------------------------------
Validating inputs...
Remember to tweak PHP.INI for security and functionality per php.net
Finished input validation.
Press 1 to EDIT choices, or ENTER to start IIS modifications:
Starting IIS7 Configuration...
Copying "C:\Program Files\P H P\PHP.INI-Recommended" to PHP.INI...
Setting PHP Handler...
CONFIG object "system.webServer/handlers" changed
Adding and Enabling PHP in ISAPI/CGI Restriction List...
CONFIG object "system.webServer/security/isapiCgiRestriction" changed
Finished IIS7 Configuration.
Test installation using PHP file content of: <?php phpinfo();?>
* Setting up PHP5 installed at "C:\Program Files\P H P", CGI version. Notice the defaults and reminders as you change to CGI.
David.Wang's Sample PHP/IIS7 Configurator
Version: June 2006
------------------------------ Summary ------------------------------
PHP Binaries Dir : C:\Inetpub\PHP
PHP Binary Type : ISAPI
PHP Binary Name : php5isapi.dll
---------------------------------------------------------------------
Validating inputs...
ERROR: PHP Binary "C:\Inetpub\PHP\php5isapi.dll" does not exist!
Please first completely extract PHP to "C:\Inetpub\PHP"
Remember to tweak PHP.INI for security and functionality per php.net
Finished input validation.
Press 1 to EDIT choices, or ENTER to start IIS modifications:1
Press ENTER to accept [C:\Inetpub\PHP], or provide new value (folder path)
PHP Binaries Dir:C:\Program Files\P H P
Press ENTER to accept [ISAPI], or provide new value (CGI or ISAPI)
PHP Binary Type:cgi
Press ENTER to accept [php5isapi.dll], or provide new value (filename)
PHP Binary Namehp-cgi.exe
David.Wang's Sample PHP/IIS7 Configurator
Version: June 2006
------------------------------ Summary ------------------------------
PHP Binaries Dir : C:\Program Files\P H P
PHP Binary Type : cgi
PHP Binary Name : php-cgi.exe
---------------------------------------------------------------------
Validating inputs...
ERROR: PHP CGI requires modifying cgi.force_redirect to 0 in "C:\Program Files\P H P\PHP.INI"
Remember to tweak PHP.INI for security and functionality per php.net
Finished input validation.
Press 1 to EDIT choices, or ENTER to start IIS modifications:
Starting IIS7 Configuration...
Copying "C:\Program Files\P H P\PHP.INI-Recommended" to PHP.INI...
Setting PHP Handler...
CONFIG object "system.webServer/handlers" changed
Adding and Enabling PHP in ISAPI/CGI Restriction List...
CONFIG object "system.webServer/security/isapiCgiRestriction" changed
Finished IIS7 Configuration.
Test installation using PHP file content of: <?php phpinfo();?>
Enjoy.
//Ferron
//just a simple to ensure everything is AOK
@IF ?%_ECHO%?==?? ECHO OFF
SETLOCAL
SET DIR_PHP_FROM=%SYSTEMDRIVE%\Inetpub\PHP
SET PHP_TYPE=ISAPI
SET PHP_MODULE=IsapiModule
SET PHP_BINARY=php5isapi.dll
:Menu
ECHO.
ECHO David.Wang's Sample PHP/IIS7 Configurator
ECHO Version: June 2006
ECHO.
ECHO ------------------------------ Summary ------------------------------
ECHO PHP Binaries Dir : %DIR_PHP_FROM%
ECHO PHP Binary Type : %PHP_TYPE%
ECHO PHP Binary Name : %PHP_BINARY%
ECHO ---------------------------------------------------------------------
REM
REM Do some basic validations
REM
ECHO.
ECHO Validating inputs...
IF /I ?%PHP_TYPE%? NEQ ?CGI? IF /I ?%PHP_TYPE%? NEQ ?ISAPI? ECHO.&ECHO ERROR: Binary Type MUST be either CGI or ISAPI
FOR %%I IN ( %PHP_BINARY% ) DO (
IF /I ?%PHP_TYPE%? EQU ?CGI? IF /I ?%%~xI? NEQ ?.exe? ECHO.&ECHO WARNING: Binary Type %PHP_TYPE% requires a CGI EXE binary
IF /I ?%PHP_TYPE%? EQU ?ISAPI? IF /I ?%%~xI? NEQ ?.dll? ECHO.&ECHO WARNING: Binary Type %PHP_TYPE% requires an ISAPI DLL binary
)
IF NOT EXIST "%DIR_PHP_FROM%\%PHP_BINARY%" (
ECHO.
ECHO ERROR: PHP Binary "%DIR_PHP_FROM%\%PHP_BINARY%" does not exist!
ECHO Please first completely extract PHP to "%DIR_PHP_FROM%"
)
IF /I ?%PHP_TYPE%? EQU ?CGI? SET PHP_MODULE=CgiModule
IF /I ?%PHP_TYPE%? EQU ?CGI? ECHO.&ECHO ERROR: PHP CGI requires modifying cgi.force_redirect to 0 in "%DIR_PHP_FROM%\PHP.INI"
IF /I ?%PHP_BINARY%? NEQ ?php5isapi.dll? IF /I ?%PHP_BINARY%? NEQ ?php-cgi.exe? ECHO.&ECHO WARNING: Unrecognized PHP binary %PHP_BINARY%
ECHO.
ECHO Remember to tweak PHP.INI for security and functionality per php.net
ECHO Finished input validation.
ECHO.
SET GO=
SET /P GO=Press 1 to EDIT choices, or ENTER to start IIS modifications:
IF ?%GO%? EQU ?? GOTO :Start
ECHO.
ECHO Press ENTER to accept [%DIR_PHP_FROM%], or provide new value (folder path)
SET /P DIR_PHP_FROM=PHP Binaries Dir:
ECHO Press ENTER to accept [%PHP_TYPE%], or provide new value (CGI or ISAPI)
SET /P PHP_TYPE=PHP Binary Type:
ECHO Press ENTER to accept [%PHP_BINARY%], or provide new value (filename)
SET /P PHP_BINARY=PHP Binary Name:
GOTO :Menu
:Start
REM
REM Start Configuration
REM
IF NOT EXIST "%DIR_PHP_FROM%\%PHP_BINARY%" (
ECHO.
ECHO ERROR: PHP Binary "%DIR_PHP_FROM%\%PHP_BINARY%" does not exist!
ECHO Please first completely extract PHP to "%DIR_PHP_FROM%"
GOTO :EOF
)
ECHO.
ECHO Starting IIS7 Configuration...
ECHO.
ECHO Copying "%DIR_PHP_FROM%\PHP.INI-Recommended" to PHP.INI...
COPY /Y "%DIR_PHP_FROM%\PHP.INI-Recommended" "%DIR_PHP_FROM%\PHP.INI" >NUL
PUSHD %SYSTEMROOT%\System32\inetsrv
ECHO Setting PHP Handler...
APPCMD SET CONFIG -section:handlers "-+[name='PHP-%PHP_TYPE%',path='*.php',verb='GET,HEAD,POST',modu les='%PHP_MODULE%',scriptProcessor='%DIR_PHP_FROM% \%PHP_BINARY%',resourceType='File']"
ECHO Adding and Enabling PHP in ISAPI/CGI Restriction List...
APPCMD SET CONFIG -section:isapiCgiRestriction "-+[path='%DIR_PHP_FROM%\%PHP_BINARY%',allowed='true', groupId='PHP',description='PHP']"
POPD
ECHO.
ECHO Finished IIS7 Configuration.
ECHO.
ECHO Test installation using PHP file content of: ^<?php phpinfo();?^>
ENDLOCAL
I saw this blog but it was a bit confusing. >> http://blogs.msdn.com/david.wang/arc...S7_Part_2.aspx
I always use CGI, which is better API or CGI? and why?
Is there a simplier way to do this?
I was wondering if the php MIME Type is ' application/octet-stream '
Last edited by Utech22; Jun 15, 2007 at 04:31 PM. Reason: site link
|--- www.RealJamaicaEstate.com ™ ---|
Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
--- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com ™
# MIME type Extension
application/EDI-Consent
application/EDI-X12
application/EDIFACT
application/activemessage
application/andrew-inset ez
application/applefile
application/atomicmail
application/cals-1840
application/commonground
application/cybercash
application/dca-rft
application/dec-dx
application/eshop
application/hyperstudio
application/iges
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc
application/mathematica
application/msword doc
application/news-message-id
application/news-transmission
application/octet-stream bin dms lha lzh exe class
application/oda oda
application/pdf pdf
application/pgp-encrypted
application/pgp-keys
application/pgp-signature
application/pkcs10
application/pkcs7-mime
application/pkcs7-signature
application/postscript ai eps ps
application/prs.alvestrand.titrax-sheet
application/prs.cww
application/prs.nprend
application/remote-printing
application/riscos
application/rtf rtf
application/set-payment
application/set-payment-initiation
application/set-registration
application/set-registration-initiation
application/sgml
application/sgml-open-catalog
application/slate
application/smil smi smil
application/vemmi
application/vnd.3M.Post-it-Notes
application/vnd.FloGraphIt
application/vnd.acucobol
application/vnd.anser-web-certificate-issue-initiation
application/vnd.anser-web-funds-transfer-initiation
application/vnd.audiograph
application/vnd.businessobjects
application/vnd.claymore
application/vnd.comsocaller
application/vnd.dna
application/vnd.dxr
application/vnd.ecdis-update
application/vnd.ecowin.chart
application/vnd.ecowin.filerequest
application/vnd.ecowin.fileupdate
application/vnd.ecowin.series
application/vnd.ecowin.seriesrequest
application/vnd.ecowin.seriesupdate
application/vnd.enliven
application/vnd.epson.salt
application/vnd.fdf
application/vnd.ffsns
application/vnd.framemaker
application/vnd.fujitsu.oasys
application/vnd.fujitsu.oasys2
application/vnd.fujitsu.oasys3
application/vnd.fujitsu.oasysgp
application/vnd.fujitsu.oasysprs
application/vnd.fujixerox.docuworks
application/vnd.hp-HPGL
application/vnd.hp-PCL
application/vnd.hp-PCLXL
application/vnd.hp-hps
application/vnd.ibm.MiniPay
application/vnd.ibm.modcap
application/vnd.intercon.formnet
application/vnd.intertrust.digibox
application/vnd.intertrust.nncp
application/vnd.is-xpr
application/vnd.japannet-directory-service
application/vnd.japannet-jpnstore-wakeup
application/vnd.japannet-payment-wakeup
application/vnd.japannet-registration
application/vnd.japannet-registration-wakeup
application/vnd.japannet-setstore-wakeup
application/vnd.japannet-verification
application/vnd.japannet-verification-wakeup
application/vnd.koan
application/vnd.lotus-1-2-3
application/vnd.lotus-approach
application/vnd.lotus-freelance
application/vnd.lotus-organizer
application/vnd.lotus-screencam
application/vnd.lotus-wordpro
application/vnd.meridian-slingshot
application/vnd.mif mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.ms-artgalry
application/vnd.ms-asf
application/vnd.ms-excel
application/vnd.ms-powerpoint ppt
application/vnd.ms-project
application/vnd.ms-tnef
application/vnd.ms-works
application/vnd.music-niff
application/vnd.musician
application/vnd.netfpx
application/vnd.noblenet-directory
application/vnd.noblenet-sealer
application/vnd.noblenet-web
application/vnd.novadigm.EDM
application/vnd.novadigm.EDX
application/vnd.novadigm.EXT
application/vnd.osa.netdeploy
application/vnd.powerbuilder6
application/vnd.powerbuilder6-s
application/vnd.rapid
application/vnd.seemail
application/vnd.shana.informed.formtemplate
application/vnd.shana.informed.interchange
application/vnd.shana.informed.package
application/vnd.street-stream
application/vnd.svd
application/vnd.swiftview-ics
application/vnd.truedoc
application/vnd.visio
application/vnd.webturbo
application/vnd.wap.slc slc
application/vnd.wap.sic sic
application/vnd.wap.wmlc wmlc
application/vnd.wap.wmlscriptc wmlsc
application/vnd.wrq-hp3000-labelled
application/vnd.wt.stf
application/vnd.xara
application/vnd.yellowriver-custom-menu
application/wita
application/wordperfect5.1
application/x-bcpio bcpio
application/x-bzip2 bz2
application/x-cdlink vcd
application/x-chess-pgn pgn
application/x-compress
application/x-cpio cpio
application/x-csh csh
application/x-director dcr dir dxr
application/x-dvi dvi
application/x-futuresplash spl
application/x-gtar gtar
application/x-gzip gz tgz
application/x-hdf hdf
application/x-javascript js
application/x-kword kwd kwt
application/x-kspread ksp
application/x-kpresenter kpr kpt
application/x-kchart chrt
application/x-killustrator kil
application/x-koan skp skd skt skm
application/x-latex latex
application/x-netcdf nc cdf
# The standard is that rpm is audio/x-pn-realaudio-plugin... oh well...
application/x-rpm rpm
application/x-sh sh
application/x-shar shar
application/x-shockwave-flash swf
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
application/x-tar tar
application/x-tcl tcl
application/x-tex tex
application/x-texinfo texinfo texi
application/x-troff t tr roff
application/x-troff-man man
application/x-troff-me me
application/x-troff-ms ms
application/x-ustar ustar
application/x-wais-source src
application/x400-bp
application/xml
application/zip zip
audio/32kadpcm
audio/basic au snd
audio/midi mid midi kar
audio/mpeg mpga mp2 mp3
audio/vnd.qcelp
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ram rm
audio/x-realaudio ra
audio/x-wav wav
chemical/x-pdb pdb xyz
image/cgm
image/g3fax
image/gif gif
image/ief ief
image/jpeg jpeg jpg jpe
image/naplps
image/png png
image/prs.btif
image/tiff tiff tif
image/vnd.dwg
image/vnd.dxf
image/vnd.fpx
image/vnd.net-fpx
image/vnd.svf
image/vnd.wap.wbmp wbmp
image/vnd.xiff
image/x-cmu-raster ras
image/x-portable-anymap pnm
image/x-portable-bitmap pbm
image/x-portable-graymap pgm
image/x-portable-pixmap ppm
image/x-rgb rgb
image/x-xbitmap xbm
image/x-xpixmap xpm
image/x-xwindowdump xwd
message/delivery-status
message/disposition-notification
message/external-body
message/http
message/news
message/partial
message/rfc822
model/iges igs iges
model/mesh msh mesh silo
model/vnd.dwf
model/vrml wrl vrml
multipart/alternative
multipart/appledouble
multipart/byteranges
multipart/digest
multipart/encrypted
multipart/form-data
multipart/header-set
multipart/mixed
multipart/parallel
multipart/related
multipart/report
multipart/signed
multipart/voice-message
text/css css
text/directory
text/enriched
text/plain asc txt
text/prs.lines.tag
text/rfc822-headers
text/richtext rtx
text/rtf rtf
text/sgml sgml sgm
text/tab-separated-values tsv
text/uri-list
text/vnd.abc
text/vnd.flatland.3dml
text/vnd.fmi.flexstor
text/vnd.in3d.3dml
text/vnd.in3d.spot
text/vnd.latex-z
text/vnd.wap.sl sl
text/vnd.wap.si si
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-setext etx
text/xml xml
video/mpeg mpeg mpg mpe
video/quicktime qt mov
video/vnd.motorola.video
video/vnd.motorola.videop
video/vnd.vivo
video/x-msvideo avi
video/x-sgi-movie movie
x-conference/x-cooltalk ice
text/html html htm
Last edited by ferronrsmith; Jun 15, 2007 at 05:39 PM.
A MIME attachment with the content type "application/octet-stream" is a binary file. Typically, it will be an application or a document that must be opened in an application, such as a spreadsheet or word processor. If the attachment has a filename extension associated with it, you may be able to tell what kind of file it is. A .exe extension, for example, indicates it is a Windows or DOS program (executable), while a file ending in .doc is probably meant to be opened in Microsoft Word.
No matter what kind of file it is, an application/octet-stream attachment is rarely viewable in an email, Usenet, or World Wide Web program. If you are using a text-based client, such as Pine, trn, or Lynx, save the attachment to your account, then transfer it to your personal computer. If you are using a workstation-based client, such as Eudora or Outlook, the application should be able to extract and download the attachment automatically. You must then open the attachment in the appropriate application to view its contents.
Note: In addition to the generic application/octet-stream content type, you will also encounter attachments that have different sub-types (e.g., application/postscript, application/x-macbinary, and application-msword). They are similar to application/octet-stream, but apply to specific kinds of files.
Also see:
Last edited by ferronrsmith; Jun 15, 2007 at 05:38 PM.
APIs are proprietary programming interfaces supported by particular
platforms. By using an API, you lose all portability. If you know
your application will only ever run on one platform (OS and HTTPD),
and it has a suitable API, go ahead and use it. Otherwise stick to CGI.
http://forums.iis.net/1102.aspx
check this site for aid
i tried it and got this error
Server Error in Application "Default Web Site/PmsNetBeta"
HTTP Error 404.3 - Not Found
Description: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.
Error Code: 0x80070032
Notification: ExecuteRequestHandler
Module: StaticFileModule
Requested URL: http://localhost:80/pmsnetbeta/login.aspx
Physical Path: C:\inetpub\wwwroot\PmsNetBeta\login.aspx
Logon User: Anonymous
Logon Method: Anonymous
Handler: StaticFile
Most likely causes:
* It is possible that a handler mapping is missing. By default, the static file handler processes all content.
* The feature you are trying to use may not be installed.
* The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)