This is driving me absolutely crazy so I could really use another pair of eyes! I've just rebuilt a Compaq with W2K3 SP2 and the latest security updates. The server will function as a WIMP web server. I have MySQL 5.1.39 installed and have confirmed connectivity via the MySQL Administrator. I have PHP ver5.2.11 installed but I'm only able to view the PHPInfo page. If I add another php page I get the following message in IE and Firefox:
The webpage cannot be found
Most likely causes:
There might be a typing error in the address.
If you clicked on a link,
More information:
This error (HTTP 404 Not Found) means that Internet was able to connect to the website, but the page you wanted was not found. It's possible the webpage is temporarily unavailable.
This only happens when trying to view .php pages as I'm able to see .htm pages.
~stumped!!!~
I've tried PHP versions 5.2.11 & 5.3 and they both seem to produce the same results. Here are my documented steps:
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. For me this will be “D:\Downloads\PHP”.
4. Create a new folder on the root drive called “PHP”. For me this would be “C:\PHP”.
5. Navigate to the location the file were saved to and extract the contents to the folder you just created. For me this would be “C:\PHP”.
Note: The recommendation is to extract the PHP files to a folder created on the root drive.
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
- Download the PECL extensions from the following location:
http://us3.php.net/get/pecl-5.2.5-Win32.zip/from/a/mirror - Save the “pecl-5.2.5-Win32.zip” file to a location on the local system or network share. For me this would be “D:\Downloads\PHP/Tools/PECL”.
- Navigate to this location and extract the contents of the zip file to the “pecl-5.2.5-Win32” folder.
- Copy the contents of this folder to the “C:\PHP\ext” folder.
- 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
Note:
1. php5activescript.dll is a “Java Native Interface (JNI)” file used by applications like Tomcat to make connections to PHP.
2. php5servlet.dll is a “Component Object Model (COM)” server that allows Active Script engines to execute PHP code.
Configure PHP ver5.2.11
11. While in the location you extracted the files to, C:\PHP, locate the “php.ini-recommend” file and rename it to “php.ini”.
12. Once renamed copy the “php.ini” file to the “C:\Windows” directory.
Optional Steps:
Configure “Session State”
13. Navigate to the folder you extracted PHP to and create a new folder called “Sessions” within that folder. For me this would be “C:\PHP\Sessions”.
14. Navigate to “C:\Windows” and use Notepad to open the “php.ini” file.
15. Search for the “Session.save_path” variable and change the path to point to the location of the newly created “Sessions”. So I’d be changing it to “C:\PHP\Sessions”.
16. You also need to uncomment this variable by removing the semi colon ( that precedes it. So I end up with the following:
Optional:
17. Locate “cgi.force_redirect” and change it from “1” to “0”.
Configure Magic Quotes
18. Search for “magic_quotes_gpc” and change the setting from “Off” to “On”.
Optional: Change Display Errors
19. Search for “display_errors” and change the setting from “Off” to “On”.
Optional: Install the php_Browscap.ini File
20. Download the file from the following location:
http://browsers.garykeith.com/downloads.asp
21. Save the “php_browscap.ini” file to a location on the local system or network share.
22. Navigate to the location you saved the file to and copy it to the “C:\PHP\extras” folder.
23. Open the “php.ini” file and locate the “browscap” variable and change the path to point to the location of the file. This would be “C:\PHP\extras\php_browscap.ini”.
Note: Before using the “browscap.ini” you may want to take a minute and read the “Terms or Use” provided by the developer.
Configure PHP Extensions
24. Next 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”.
Now scroll down and look for the PHP extensions and uncomment the ones that are to be used. For me this would be:
a. extension=php_gd2.dll
b. extension= php_curl.dll
c. extension=php_mbstring.dll
d. extension=php_mcrypt.dll
e. extension=php_mysql.dll
f. extension=php_mysqli.dllSave and close the “php.ini” file.
Add PHP to System Path
27. Perform the following to add the “C:\PHP” folder to the server’s system PATH variable:
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 PHP folder to the either the beginning or the end of the statement.
i. Beginning: “C:\PHP”;
ii. End: ;C:\PHP, and click “OK” three times to close the windows.
Note: Make sure you add the semicolon ; before you add the C:\PHP folder. So this mean you’d add ;C:\PHP at the end of the statement.
Add Web Service Extension
28. Open the “Internet Information Services (IIS)” console and click on the “Web Service Extensions” folder.
29. Click the “Add a new Web service extension” link to open the “New Web Service Extension” box.
30. Enter “PHP-ISAPI Extension” for the name, click “Add” and browse to the location of the file.
31. Check the “Set extension status to Allowed” box and click “OK” to continue.
Note: IIS will need to be restarted in order for the new changes to take effect.
- Click Start  Programs  Administrative Tools  Internet Information Services (IIS) Manager.
- Right-Click the server name and select All Tasks  Restart IIS…
Configure IIS
34. While still in the IIS Manager console perform the following steps to add the “.php” extension:
a. Expand the server name, right-click “Web Sites” and select “Properties”.
b. Click the “Home Directory” tab and then click the “Configuration” button.
c. Click the “Add” button located on the “Mappings” tab and “Browse” or enter the path to the “C:\PHP\php5isapi.dll” file.
d. Enter “.php” in the “Extension:” box.
e. Select the “Limit to” option in the “Verbs” section and enter GET, POST, HEAD.
f. Click “OK” when finished.
g. Continue to click “OK” until all windows are closed.
35. Expand the “Default Website” and select “Properties”.
36. Next click the “Documents” tab and then the “Add” button located in the “Enable default content page” section.
37. Enter “index.php” and click “OK”.
38. Select the file and click the “Move Up” button to the move the file to the top of the list.
39. Click “OK” to close the window and follow Step #16 to restart IIS.
40. While still in IIS right-click the web server name and select “Properties”.
41. Click “MIME Types…” and then click “New”.
42. Enter .php as the “Extension” and “application/octet-stream” as the “MIM type:”.
43. Click “OK” when finished to close the windows and restart IIS.
Test PHP
44. 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>
- Save the file as “phpinfo.php” to the website root directory.
Note: to locate the website root directory:
Open a web browser and navigate to this file like so:
http://servername/phpinfo.phpThis confirms that PHP is being processed by IIS.
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.
Typing PHP at the command prompt returns no errors!!
stumped~
Any responses or direction appreciated!!!