Page 1 of 1
Newbie - Hello world not working
Posted: Fri Dec 17, 2004 12:02 am
by GDI Lord
Hi.
Im a newbie trying to get a simple Hello World program(Site?Page?) to work on my local machine. Im running Windows XP Pro SP1a. I installed all the IIS components available. Im editing/launching using Dreamweaver 2004 v7. The company is running their own proxy on port 80.
My code looks like
Code: Select all
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo "Hello World<P>"; ?>
</body>
</html>
My output is totally blank.
Site setup in Dreamweaver:
- Site Name: mySite
- Local root folder: C:\inetpub\wwwroot\mySite\
- Server model: PHP MySQL
- Access: Local/Network
- Test server folder: c:\inetpub\wwwroot\mySite\
- URL prefix: http://localhost/mysite/
- Cloaking is enabled
The IISAdmin service is started.
Any help would SERIOUSLY be appreciated!!! Thanks guys!
Posted: Fri Dec 17, 2004 1:31 am
by kettle_drum
Well there is nothing wrong with your code. Can you view any other pages from the server? or is this the only one that comes up blank? Does the file have a .php extension?
Posted: Fri Dec 17, 2004 1:44 am
by GDI Lord
Yes I can view normal html files. Slapping F12 in dreamweaver (preview in IE) with the following code shows the correct page. In IIS my site is "Default Web Site". Under properties, Web Site Identificaton, IP Address "All Unassigned" is selected. No pages are served at all if my IP Address (10.12.2.128) is selected
C:\Inetpub\wwwroot\mySite'blahblah.htm
The code for the page is
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Hello world blah blah <img src="fade.gif" width="200" height="40">
</body>
</html>
fade.gif is in the same directory as blahblah.htm. In fact fade.gif, blahblah.htm,index.php and index.php4 are all in the same directory.
My PHP page's name is index.php. I also tried index.php3 and php.4.
Thank you kettle_drum.
Posted: Fri Dec 17, 2004 1:44 am
by andre_c
Are you sure that php is installed on the server?
Posted: Fri Dec 17, 2004 2:00 am
by GDI Lord
andre_c wrote:Are you sure that php is installed on the server?
Please excuse me while I go and try to pick up my harddrive with a magnet... *very serious blush* I thought I downloaded and installed it already. I just remembered now from your post that the download a few days ago failed. Um, *coff*.
Sorry for bothering you guys. Thanks andre_c. I'll come back if there's still a problem.
Posted: Fri Dec 17, 2004 2:01 am
by kettle_drum
lol. No problem...we all make mistakes sometimes.
Still not working
Posted: Wed Dec 22, 2004 12:30 am
by GDI Lord
Hey.
The page STILL is not displaying. Im using PHP 5.0.3. In my php.ini
cgi.force_redirect = 0 and
extension=php_mysql.dll
are the only two entries I was told to modify by the install.txt(I think) and documentation for mysql, although they were like this by default.
Relevant(I hope) services:
IIS Admin - ON
FTP Publishing - ON
ICF/ICS - OFF
IPSEC - ON
MySQL - ON
Network DDE - OFF
Network DDE DSDM - OFF
SMTP - ON
Telnet - OFF
Web Client - ON
World Wide Web Publishing - ON
I am getting NOTHING. What am I doing wrong? RTFM? Which *F*M?
Thanks again guys.
Posted: Wed Dec 22, 2004 12:45 am
by GDI Lord
OK, now this is wierder. Im using code that I got from
PHPBuilder.
Code: Select all
<?php
// store.php3 - by Florian Dittmer <dittmer@gmx.net>
// Example php script to demonstrate the storing of binary files into
// an sql database. More information can be found at http://www.phpbuilder.com/
?>
<html>
<head><title>Store binary data into SQL Database</title></head>
<body>
<?php
// code that will be executed if the form has been submitted:
if ($submit) {
// connect to the database
// (you may have to adjust the hostname,username or password)
MYSQL_CONNECT("localhost","root","password");
mysql_select_db("binary_data");
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO binary_data (description,bin_data,filename,filesize,filetype) ".
"VALUES ('$form_description','$data','$form_data_name','$form_data_size','$form_data_type')");
$id= mysql_insert_id();
print "<p>This file has the following Database ID: <b>$id</b>";
MYSQL_CLOSE();
} else {
// else show the form to submit new data:
?>
<form method="post" action="<?php echo $PHP_SELF; ?>" enctype="multipart/form-data">
File Description:<br>
<input type="text" name="form_description" size="40">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
</body>
</html>
I got the following results:
// Example php script to demonstrate the storing of binary files into // an sql database. More information can be found at
http://www.phpbuilder.com/ ?>
File Description:
[textbox]
File to upload/store in database:
[textbox][button]
[button]
The buttons and textboxes display correctly.
Methinks its Dreamweaver...
Case closed
Posted: Thu Dec 23, 2004 3:43 am
by GDI Lord
Yep, it was dreamweaver. I uninstallde everything and then reinstalled everything with dreamweaver being installed last and now it works. *scratch head* Dunno what went wrong or why the order matters. Anyone want to hazard a guess?