PHP and phpMyAdmin IIS Issues on IIS (WIMP)...

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
marvinc
Forum Newbie
Posts: 1
Joined: Wed Sep 30, 2009 6:18 pm

PHP and phpMyAdmin IIS Issues on IIS (WIMP)...

Post by marvinc »

I wonder if I can get some help with what I think is a busted PHP installation onto a W2K3 server? Basically I have PHP 5.2.11 installed and I'm able to view the default phpinfo.php page but I'm unable to view any other .php pages that I place into that webites directory nor am I able to get phpMyAdmin installed. I am however able to view .htm pages I place in that web directory or any other web directory. When trying to view .php pages or configure phpMyAdmin I get the following error:

The webpage cannot be found
HTTP 404
Most likely causes:
•There might be a typing error in the address.
•If you clicked on a link, it may be out of date.

What you can try:
Retype the address.
Go back to the previous page.
Go to and look for the information you want.
More information

This error (HTTP 404 Not Found) means that Internet Explorer was able to connect to the website, but the page you wanted was not found. It's possible that the webpage is temporarily unavailable. Alternatively, the website might have changed or removed the webpage.


I've come across a few tutorials that cover the install but they all seem different so I've put together my own and wonder if I can get a second set of eyes to help me figure out where I'm going wrong. These steps cover my PHP ver5.2.11 manual installation onto a Windows 2003 SP2 server with MySQL already installed:

Download and Extract PHP ver5.2.11
1. Download the latest version of PHP from the following location:
http://www.php.net/downloads.php
2. Click the “PHP 5.2.11 zip package” link and locate a mirror that’s in your general vicinity. Click it to initiate the download.
3. Save the “php-5.2.11-Win32.zip” file to a location on the local system or network share.
4. Navigate to the location the “php-5.2.11-Win32.zip” file was saved to, right-click, and extract its contents to the same location. The extraction creates the “php-5.2.11-Win32” folder.
5. Copy the entire folder to website root directory, which leaves your with “C:\ php-5.2.11-Win32”.
6. Rename this folder to “PHP”, which leaves you with “C:\PHP”.

Add PHP to Windows System Path
7. Perform the following to add the “C:\PHP” folder to the server’s “System Path”:
a. Right-click “My Computer” and select “Properties”.
b. Click the “Advanced” tab and then click the “Environment Variables” button.
c. Double-click the “Path” variable located in the “System Variables” section.
d. Add the “C:\PHP;” path to the end of the statement. Without the quotes.
e. Click “OK” when finished and restart the server.

Note: Make sure you add the semicolon at the end of the path. So you’d end up with C:\PHP;.

Add PHP Extensions to IIS
8. Click Start - Programs - Administrative Tools - Internet Information Services (IIS) Manager to open the management console and select the “Web Service Extensions” folder.
9. Click the “Add a new Web service extension” link to open the “New Web Service Extension” box.
10. Enter “PHP-ISAPI Extension” for the name, click “Add” and browse to the location of the “php5isapi.dll” file, which should be “C:\PHP”.
11. Check the “Set extension status to Allowed” box and click “OK” to continue.
12. Next right-click the “Web Sites” node and select “Properties”. The “Web Site Properties” window opens.
13. Click the “Home Directory” tab and make sure the “Scripts only” box is checked under “Execute Permissions”.
14. Click the “Configuration” button and perform the following:
a. Click the “Add” button and then “Browse” to the location of the “php5isapi.dll” file, which should be “C:\PHP”.
b. Enter “.php”, without the quotes, in the “Extensions” window.
c. Select the “Limit to” option in the “Verbs” section and enter GET, POST, HEAD.
d. Click “OK” until you’re back at the “Web Site Properties” window. .
15. Click the “ISAPI Filters” tab and click the “Add” button.
16. Enter PHP as the filter name and browse to the location of the “php5isapi.dll” file, which should be “C:\PHP”.
17. Click “OK” to close the window.
18. Click the “Documents” tab and then the “Add” button located in the “Enable default content page” section.
19. Enter “index.php” and click “OK”.
20. Select the “index.php” file and click the “Move Up” button to place the file at the top of the list.
21. Click “OK” to close the window.
22. Click Start - Programs - Administrative Tools - Internet Information Services (IIS) Manager to open the management console.
23. Right-click the server name and select All Tasks - Restart IIS.

Configure the PHP.ini File
24. Navigate to the location you extracted the files to, C:\PHP, locate the “php.ini-recommend” file, and copy it to the “C:\Windows” directory.
25. Rename the file to “php.ini”, use Notepad to open it and configure it accordingly.
a. Navigate to the folder you extracted PHP to and create a new folder called “sessions” within that folder. So you end up with “C:\PHP\sessions”.
i. Search for the “Session.save_path” variable and change the path to point to the location of the newly created “Sessions” folder. So you end up with “C:\PHP\Sessions”.
b. Locate “doc_root” and set it to the path of the root directory. For me this would be “F:\webdirectory”.
c. Locate “cgi.force_redirect” and change it from “1” to “0”.
d. Search for “magic_quotes_gpc” and change the setting from “Off” to “On”.
e. Search for “display_errors” and change the setting from “Off” to “On”.
f. Search for the “extension_dir” variable and change the path to point to the location of the PHP extension directory. For me this would be “C:\PHP\ext”.
g. Scroll down and look for the PHP extensions and uncomment the ones that are to be used. For me these would be:
i. extension= php_curl.dll
ii. extension=php_gd2.dll
iii. extension=php_mbstring.dll
iv. extension=php_mcrypt.dll
v. extension=php_mysql.dll
vi. extension=php_mysqli.dll
vii. extension=php_pdo.dll
viii. extension=php_pdo_mysql.dll

Add the php_Browscap.ini File
h. Download the file from the following location:
http://browsers.garykeith.com/downloads.asp
i. Save the “php_browscap.ini” file to a location on the local system or network share.
j. Navigate to the location you saved the file to and copy it to the “C:\PHP\extras” folder.
k. Search for the “browscap” variable and change the path to point to the location of the file. This would be “C:\PHP\extras\php_browscap.ini”.
26. Save and close the “php.ini” file.
27. Click Start  Programs  Administrative Tools  Internet Information Services (IIS) Manager to open the management console.
28. Right-click the server name and select All Tasks  Restart IIS.

Download and Extract the PECL Win32 Binaries

Note: PECL = PHP Extension Community Library. These are additional libraries that expand on PHP’s core functionality. More information on the libraries can be found below:
http://pecl4win.php.net/index.php

29. Download the PECL extensions from the following location:
http://us3.php.net/get/pecl-5.2.5-Win32 ... m/a/mirror
30. Save the “pecl-5.2.5-Win32.zip” file to a location on the local system or network share.
31. Right-click and extract the contents of the zip file to the “pecl-5.2.5-Win32” folder.
32. Copy the contents of this folder to the “C:\PHP\ext” folder.
33. While in the “C:\PHP\ext” folder locate the following files and move them to the “C:\PHP” directory:
a. php5activescript.dll
b. php5servlet.dll
34. Register the “php5activescript.dll” file at the command prompt.

Test PHP
35. Open Notepad and enter the following code:

<?php
phpinfo();
?>

or

<?php
// testing sessions
// check to see if files are being created
// in the session.save_path folder
session_start();
?>
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>
The browser you're using is
<?php echo $_SERVER['HTTP_USER_AGENT']; ?>
</p>
<p>
<!-- test the browscap setup -->
Your browser's capabilities are: <br/>
<pre>
<?php print_r(get_browser(null, true)); ?>
</pre>
</p>
<?php phpinfo(); ?>
</body>
</html>

36. Save the file as “phpinfo.php” to the website root directory.
37. Open a web browser and navigate to this file like so: http://servername/phpinfo.php
38. This confirms that PHP is being processed by IIS.
39. As a final test open a command prompt and type php. If there are any issues with the PHP install the errors will be presented to you here as they appear in the log file.

Again my problem is that I'm unable to view any .php files I place into my web directory. I am however able to view .htm files. I've removed and re-installed IIS and PHP numerous times to yield the same results so I'm sure I'm overlooking something simple.

Any responses appreciated.
Post Reply