[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

PHP Setup on IIS Server

Posted on 2007-10-03
9
Medium Priority
?
323 Views
Last Modified: 2010-04-20
Experts,

I am a newbie to programming and I have chosen PHP to setup and learn because I have read it is a easier language to pick up and who can beat the price of free.

I have setup a Windows 2003 box running IIS.  I currently have an intranet site where the files are stored on my D: drive and the web page just points to this folder.

What I am needing to know is a how to get the PHP setup started and the correct way to set this up.  

Since my files are on D:

1. Do I need to install PHP on the D: drive as well so it places the PHP folder and php.ini file on D:?

2. Do I move my files from the Intranet folder to the PHP folder?

I am giving the max points on this because I need help getting this going.  I have read several articles but i haven't seen anything address these types of questions.
0
Comment
Question by:smartin0924
  • 6
  • 3
9 Comments
 
LVL 6

Accepted Solution

by:
ajarvey earned 2000 total points
ID: 20009409
Simply download the PHP Installer (not the ZIP file/manual install) from http://www.php.net and follow the prompts to install for your version of IIS. The installation is very straight forward. The only thing you will need to worry about after the fact is allowing your "web user" (computer account used for anonymous web access to your website) NTFS permissions to the PHP folder, wherever you device to install it. It does not matter which drive you install PHP onto. So long as you run through teh installer, everything should work out of the box (after adding the NTFS permissions, that is).
0
 
LVL 1

Author Comment

by:smartin0924
ID: 20009477
Thanks for replying ajarvey,

Do I choose IIS ISAPI module or IIS CGI?  Also, what are the extensions it ask for ie; Activescript, ADT, APD,APC, bcompiler...

Do i need to install any of these?
0
 
LVL 6

Expert Comment

by:ajarvey
ID: 20009633
I personally would choose the CGI installation, as the ISAPI version can be somewhat cumbersome to get working properly. The only time I reccomend setting up the ISAPI version is if you have a very high traffic site which relies heavily on PHP. The ISAPI version scales better than the CGI version. As far as the other options, the defaults should work just fine. No need to install something if you're not going to utilize it.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:smartin0924
ID: 20009963
OK, I finished the install and created a php file but it will not display.  I created a test file:
<? php

phpinfo();

?>

I saved it to my D:\Intranet but nothing happened.  It tells me the file can not be displayed.  I installed PHP on the C: drive and I added the index.php extension to the Documents tab under the properties of the Webpage.

I also modified the php.ini file to look like this:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root = "D:\Intranet"<--------------------------------------------------------------------This is what I modified---------------------------------------------------

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir ="C:\Program Files\PHP\ext"

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**

0
 
LVL 6

Expert Comment

by:ajarvey
ID: 20010028
What is actually displayed in the browser? Is it a 404 error, or something else?
0
 
LVL 1

Author Comment

by:smartin0924
ID: 20013372
No, it comes back telling me that the page can not be found.  The file is in the root directory of D:\Intranet\helloworld.php.   Here is the path on the web server:  http://intranet.hct.local/helloworld.php
How can I tell if PHP is running?  Will it show up as a service?

Now the folder that is under C:\Program Files\PHP there are 2 exe files in there.  Do I need to do anything with these?
0
 
LVL 1

Author Comment

by:smartin0924
ID: 20013500
OK, I'm getting something different now.  I removed PHP and reinstalled it to C:\PHP  I read in the manual that says installing it to C:\Program Files\PHP can cause an error.   I also made a copy of my last php.ini file and moved it to the new directory under c:php.

Here is what Im getting now.

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.

thank you.
0
 
LVL 1

Author Comment

by:smartin0924
ID: 20013652
OK, we got it working.    I am able to display the info.php page and I created the infamous "Hello World".  Thanks ajarvey.
0
 
LVL 1

Author Comment

by:smartin0924
ID: 20013700
Just to make an addittional comment for anyone else who may reference this, when I copied my first php.ini file to the new install directory, it had several errors because alot of the paths to the extensions installed were pointing to the old installation path. C:\Program Files\PHP  instead of C:\PHP.  In order to get my original back, I had to uninstall and reinstall PHP again and then I modified  this one.  So lesson learn on my part.

Thanks Again ajarvey.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question