Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 26542

Unable to get PHP working with IIS7

$
0
0

I just tried to install PHP with IIS and am unable to get it to work.

My problem is that the PHP script portion of my webpage is not executed when I browse my simple test webpage from IIS manager. If I show the page source, the PHP script is displayed which, as I understand it, means the web server is not processing the script. The non-PHP portion of the webpage is correctly displayed.

If I extract the PHP script portion from the webpage, and paste it into a PHP file, I can successfully execute that script from the DOS command prompt so I assume the PHP syntax is correct.

This is the first time I've tried to create a website so it is possible I've missed some obvious steps but have been unable to solve this with what I've found so far on various forums.

I did try to install PHP using the MS Web Platform Installer but I did not discover that method until I had installed PHP on its own so it is possible that I've installed something in the wrong order. I've tried to pull everything out and reinstall it but that hasn't worked.

Here are more details:

Contents of iisstart.htm
<!DOCTYPE html>
<html>
<body>
test

<?php
echo "My first PHP script!";
?>
</body>
</html>

Version Information:
Windows 7 Version 6.1 Build 7601 SP1
IIS Version 7.5.7600.16385
PHP version 5.4.17

Control Panel Windows Features

Under Internet Information Services->World Web Services->Application Development Features, the following are turned on:  .NET Extensibility, CGI

IIS FastCGI Settings
Full path is "C:\Program Files (x86)\PHP\v5.4\php_cgi.exe"
Max instances was zero but I changed it to 4
FastCGI Settings are only shown for my computer, not my website, is this correct?

IIS Handler Mappings
These are set at the computer level and inherited by my website.
Request Path:*.php
Module: FastCgiModule
Executable: "C:\Program Files (x86)\PHP\v5.4\php-cgi.exe"
Name: php-5.4.17
Mapping: Invoke handler only if request is mapped to: (this is checked)  File or Folder (this is also checked)
Verbs: One of the following Verbs: GET,HEAD,POST
Access: Script

IIS MIME Types:
These are set at the computer level and inherited by my website.
Extension: .php
MIME Type: application/x-httpd-php

php.ini file
I have PHP manager loaded so if I run IIS manager, click on my website and run PHP Manager, it shows that the php.ini file is being loaded from "C:\Program Files (x86)\PHP\v5.4\php.ini" which is what I expect.

IIS cgi.force_redirect
PHP manager shows cgi.force_redirect set to 0 for both the local and master value.

Again, any help you can provide will be very appreciated!


Viewing all articles
Browse latest Browse all 26542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>