-
Cannot get php script to run properly on local machine
I've downloaded and installed php v5 on to a Windows 2000 pc. If I run the following
<?php
phpinfo();
?>
in c:\inetpub\wwwroot it returns all the configuration data.
but if I run the following in C:
<html>
<head>
<title>Billy's Auto Parts - Order results</title>
</head>
<body>
<h1> Billy's Auto Parts</h1>
<h2>Order results</h2>
<?php
echo '<p>order 2 processed</p>' ;
?>
</body>
</html>
the echo shows nothing in IE6 and shows
order 2 processed
' ; ?>
in Mozilla. I have tried changing <?php ?> to <script language="php"></script> but get no echo in IE6 or Mozilla.
I can't believe I'm stuck at what is essentially "hello world".
I've tried changing the single quotes after echo to doubles but the reults are the same (except Mozilla now shows the closing double quote).
Help, please
Cheers
Billy
-
-
You are accessing the page via your webserver, aren't you? It won't be parsed as PHP otherwise.
-
-
Hi Twey
As far as I know I am. I have edited the config file for windows and added php to servers.
Or do I have to make an explicit to something?
Cheers
Billy
-
-
How do you access the page? Describe the steps.
-
-
I have a simple form called test.htm and processorder in inetpub/wwwroot
<!--test.htm-->
<form action="processorder.php" method="post">
<table>
<tr bgcolor="#ccccc">
<td width="150">Item</td>
<td width="15">Quantity</td>
</tr>
<tr>
<td>Tyres</td>
<td align="center"><input type="text" name="tireqty" size="3" maxlength="3" /></td>
</tr>
<tr>
<td>Oil</td>
<td align="center"><input type="text" name="oilqty" size="3" maxlength="3" /></td>
</tr>
<tr>
<td>Plugs</td>
<td align="center"><input type="text" name="sparkqty" size="3" maxlength="3" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit Order " /> </td>
</tr>
</table>
</form>
and processorder.php is
<html>
<head>
<title>Billy's Auto Parts - Order results</title>
</head>
<body>
<h1> Billy's Auto Parts</h1>
<h2>Order results</h2>
<?php
echo '<p>order 2 processed</p>' ;
?>
</body>
</html>
Cheers
Billy
-
-
No,what I think Twey means is are you using a webserver. It's not enough to have PHP installed you also need a webserver such as Apache. You can't just acces the pages like you would for an html file.
-
-
I'm using IIS as the webserver.
PHP.net provide a version which runs under IIS, which is what I've downloaded. They also have a Windows installer which is what I used to install. I read the install notes and followed the instructions there for modifying the config (php.ini) file.
I have followed all the advised steps. I have the PHP dll (running as a cgi-exe rathe rthan ISAPI - can't remember the name off the top of my head) in the environment path.
I've read the installation notes, checked out posts here, read the PHP and Microsoft sites and have tried to extract from them all what needs to be done and am stumped.
Unless I've totally misunderstood all the documentation, I do not need Apache as PHP should run under IIS (which it obviously does when I run phpinfo() without a problem.
Cheers
Billy
-
-
Yes, it seems to run fine for the phpinfo() test, but not parse the PHP for the other. Does it work if you put the "Hello" test under the same directory as the phpinfo()?
-
-
No, I've tried that - sorry, I should have stated so originally.
Cheers
Billy
-
-
Getting somewhere.
If I type
http://localhost/processorder.php
in the browser address box the script runs ok. I can live with this.
Thanks to all who have tried to help.
Cheers
Billy
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks