PDA

View Full Version : PHP and Server 2003


boondocksaint
04-16-2005, 06:21 PM
I seem to be having problems with PHP on Windows Server 2003.

I tried installing with the Windows Installer and Unzipping...

I even added the extension .php to the extension list in IIS.

But when I try opening a php file; even with this <?php
echo '<p>Testing</p>';
?>
Nothing happens.

Is there any way to get PHP 5.0.4 working?

P.S. The reason for all of this is I'm leaning PHP and I need to test on my own computer.

Kevin Wolff
04-16-2005, 07:57 PM
Does PHP even support IIS? I know for web servers like Apache, there is a plugin add to the server itself so it can parse the files. Does this exist for IIS?

Phait
04-16-2005, 10:13 PM
If you don't mind going to Apache, you can do that, it's actually pretty simple:

www.apache.org (http://www.apache.org)
http://webmonkey.wired.com/webmonkey/00/44/index4a_page8.html?tw=programming

I think PHP supports IIS, I remember seeing something about it, but I'm not completely sure.

IceColdDuke
04-16-2005, 11:23 PM
Yes IIS supports PHP if you installed it that way. Try having the PHP extension as HTM or HTML.

Cerberus_e
04-17-2005, 05:19 AM
don't open PHP files.
for example if you want to open index.php put the location of that file in your config and go to http://localhost
make sure your server is running.

boondocksaint
04-17-2005, 10:46 AM
Thanks guys; but I managed to finally install it (successfully) and now everything works fine.

... except for the damn phpMyAdmin. There goes my day...

Thanks and peace out.

boondocksaint
05-02-2005, 10:43 PM
Okay; so all is well.
I installed (and tested "successfully") PHP, MySQL, and phpMyAdmin.

But here's what happened:
While working with forms and php:

about.html <form action="handle_about.php" method="post">
<fieldset><legend>Enter Your Information In The Form Below:</legend>
<p><b>Name:</b> <input type="text" name="name" size="20" maxlength="40" /></p>

<p><b>Interests:</b>
<input type="checkbox" name="interests[]" value="Music" /> Music
<input type="checkbox" name="interests[]" value="Movies" /> Movies
<input type="checkbox" name="interests[]" value="Books" /> Books
<input type="checkbox" name="interests[]" value="Skiing" /> Skiing
<input type="checkbox" name="interests[]" value="Napping" /> Napping
</p>
</fieldset>
<input type="submit" value="Submit Information" />
</form>

handle_about.php <?php

// Check $name and strip any slashes:
if (strlen($name) > 0) {
$name = stripslashes($name);
} else { // If no name was entered...
$name = NULL;
echo '<p><b>You forgot to enter your name!</b></p>';
}

// Check $interests[]
if (isset($interests)) {

$ints = NULL; // New message to be used.
foreach ($interests as $key => $value) { //Loop through each.
$ints .= "$value, ";
}
$ints = substr($ints, 0, -2); // Cut off the las comma-space.
$interests = TRUE;

} else {
$interests = NULL;
echo '<p><b>You forgot to enter your interests!</b></p>';
}

// If everything was filled out, print the message.
if ($name && $interests) {
echo "Thank you, <b>$name</b>. You entered your enterests as: <br /><tt>$ints</tt></p>";
}
?>

The problem arises when I go to test out the pages. I enter the info in and check the boxes (on my computer) and click go. As if the script completely skips the if part and goes right to else and tells me "Blah, blah, no name, blah, blah, blah" and same for interests.

But on other server (my website's), it works perfectly.

Now; it will be hard to help me with this problem. But please. What do I need to have enabled (in the php.ini file) or disabled to get the script to work? I'm not sure if that's going to solve it.
I have register_globals ON, by the way.

Phait
05-02-2005, 11:02 PM
First make sure your online and offline server and PHP versions are the same, or at least that either doesn't have specific changes that might cause problems or features deprecated.

boondocksaint
05-03-2005, 08:42 PM
Heh; the online server was using 4.3.9 and I was using 5.0.4.
Then I had to downgrade on MySQL version too...
Everything works now. A wise man once said, "The Latest is not necessarily the Bestest." http://forums.3drealms.com/ubbthreads/images/graemlins/smile.gif

Oh, and if anybody else ever encounters problems installing PHP on Server 2003; these two sites helped a bunch!
http://www.benmardesign.com/IIS_PHP_MYSQL_setup/php_setup.html
http://www.peterguy.com/php/install_IIS6.html