Why would my PHP code not appear in IE

Let me first say I am VERY new to PHP development, that being said.

I have IIS running on my machine and have installed PHP 5.2.6 (Installer).

I then go to Dreamweaver CS3 and create a new PHP form and nothing displays in IE. Please let me know if you need additional information in your assistance. Below is a copy of what I'm trying to run. Remember Hello World : )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<?php 
 
echo 'Hello World!'; 
 
?> 
</body>
</html>

Open in new window

LVL 1
Michael WilliamsApplication DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

k_dietzCommented:
It's hard to tell because I can't see your IIS or PHP config, but have you checked to make sure that the PHP file extension ends in the same extension listed in your Website Extensions?

IIS Manager - Website Properties - Home Directory.  Click configuration next to Application Settings.  In the Application list, is .php listed?  If so, is your Hello World document called filename.php ?

Also in IIS Manager, under Web Service Extensions, make sure that your PHP ISAPI (or CGI) extension is set to allowed.  
0
SreejithGCommented:
Please make sure that you have done application mapping for .php extension

Please follow the below steps.
1. Open "Internet Information Services" from Control panel -> Administrative tools
2. Right click on "Default wb site" in the left pane and click on properties
3. Select "Home Directory" tab
4. Click on "configuration " button
5.In the mappings tab click on add button.
6. Select php.exe as executable and give .php as extension.
8 Press OK to close each dialogs
9 Restart IIS
10. Now access your php page.
0
Michael WilliamsApplication DeveloperAuthor Commented:
SreejithG
I went through your steps and I put the following in the dialog box.
Executable: "C:\Program Files\PHP\php5ts.dll" Files\PHP\php.exe  (I browed for the dll, Files\PHP\php.exe was added)

Extension: .php

I left the rest the same. Restarted the server and received a 500 error.


k_dietz
Not sure where the web service extensions are. I did find a tab called ISAPI Filters. This is currently emplty. There is a button for adding a filter but not sure if this is what I should do.
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

k_dietzCommented:
Not to conflict with what SreejithG is saying, but if you can, use the ISAPI extension (php5isapi.dll) rather than the CGI (php.exe) because it's more secure and has a lower load on the server.

You can find Web Service Extensions in IIS Manager under your Server  (alongside Application Pools and Web Sites).

If you don't see PHP anywhere in this list, then your installation did not complete successfully.

Do you see a .php extension listed in your Application Settings?  (IS Manager - Website Properties - Home Directory.  Click configuration next to Application Settings.)

If not, then PHP -definitely- didn't install correctly.  I'd recommend following the manual installation steps (google php installation on iis manually) which is relatively painless for a guaranteed install.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michael WilliamsApplication DeveloperAuthor Commented:
k_dietz
I will try the manual installl. Should I do a Remove Program on the PHP ?
0
k_dietzCommented:
I'm not sure if it's necessary, because you will be doing all of the steps that PHP Installer would have done anyway, BUT... it would be best to start with a clean slate, so go ahead and uninstall.  That way if the installer messed anything up, it'll undo.  

Good Luck! :)
0
Michael WilliamsApplication DeveloperAuthor Commented:
I used a combination of the suggestion by k_dietz: http://us.php.net/manual/en/install.windows.manual.php

And the following link: http://www.peterguy.com/php/install_IIS6.html

1. Install PHP section
I did everything asked except for moving the php5servlet.dll file. It wasn't there.

2. Configure PHP section
I did everything except for the following 2 things:
* 2.3 Create a session state folder and point the session.save_path php.ini variable to it
* Massage the list of extensions

3. Configure IIS section
I didn't do 3.1 Add and allow the PHP ISAPI Extension to IIS Web Service Extensions: C:\PHP\php5isapi.dll  because I couldn't locate web services with my version of IIS : )

In 3.2 Add new extension (.php) I put C:\PHP\php5isapi.dll as the executable.



Everything seems to be working now. Thank you both for your help and it appears my subscription to EE is already paying off : )

Thanks again !
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.