• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
echo 'Hello World!'; 

Open in new window

Michael Williams
Michael Williams
  • 3
  • 3
3 Solutions
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.  
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.
Michael WilliamsApplication DeveloperAuthor Commented:
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.

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.
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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.
Michael WilliamsApplication DeveloperAuthor Commented:
I will try the manual installl. Should I do a Remove Program on the PHP ?
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! :)
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 !
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now