Unable to view PHP documents - Apache and PWS

liunx

Guest
I am an absolute beginner. I have purchased some materials to teach myself PHP programming, but have hit a road block immediately. I am unable to view (with IE) even the simplest PHP page that I create. The page I have created consists of:

<?php
phpinfo();
?>

And that's it. I have saved the file as Test.php but that saved as a text document, so I put it in quotes, and it's saved as a .php file. When I try t open it with IE, the screen flashes for a split second, and nothing happens. No error messages, nothing at all.

I have installed PHP on my system, and have installed both Apache and PWS (On Windows ME - I used the PWS workaround). Obviously, I must have done something wrong in the installation on either PHP or on of the web servers, but for the life of me, I can't figure it out.

This is what I've added to Apache to account for PHP:

ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "/php/php.exe"

Anyone able to troubleshoot or point me in the right direction? Any help would be greatly appreciated.ok, lets start from the top.

in apache you should have these settings in the httpd.conf file to get php going.

<IfModule mod_dir.c>
DirectoryIndex index.php index.htm index.html index.shtml
</IfModule>

line ~558
ScriptAlias /php4/ "C:/php/"
ScriptAlias /php3/ "C:/php/"

line ~765
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .php3s
#
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .php4
AddType application/x-httpd-php4 .php
AddType application/x-httpd-php4 .phtml
AddType application/x-tar .tgz

some of those may already be in there.

line ~820
Action application/x-httpd-php4 "/php/php.exe"
Action application/x-httpd-php4 "/php4/php.exe"
Action application/x-httpd-php4 "/php3/php.exe"

those are wha tyou need to get php running for apache. some of those may or may not be in there, add them if not.

lets see where that gets ya.Hmmm, still no luck. IE won't even start when I try to open my Test.php file from the htdocs folder. Opera will start, but all it displays is the hard code.Ok, now Opera is prompting me to Download the file. After I do so, the file still won't open.

Also, I am able to view HTML documents on Apache just fine.ok. what address are you typing in?

also what did you move from the php directory whe you installed php?Scoutt, it seemed the problem I had was since entering the config adjustments you gave me, I had only tried to open the PHP file by double clicking the file in the directory. Just now, I entered 127.0.0.1/test.php, and guess what? It worked!

An immense amount of thanks from me for helping me get started. I'm sure I'll be asking many more questions in the future.

Thanks again!his works and mine doesnt! dang!!!!
i didnt add all of those lines of code, the book i have ony has 3 lines... lemme try that.
i heard that every time you edit the config file u need to restart for it to work...Morrow, I read your thread and I'd bet we have the same book. "Read Less-Learn More PHP" published by Visual. All I can say is the book's directions didn't get me running, but Scoutt's advice did.well there you go, that is why your book was wrong. you need all those lines, that is why you were getting the Download box, your mime_type was wrong. and yes you should restart the server each time.yep we have the same book! :)
ok well the notepad file on this comp doesnt have a GoTo line function so im not even gonna try it here. I found out which file i need to Download to use Apache from the website, and I'll do that when I get home... I have a good feeling about this, like it might actually work :)!All I did was use the "find" tool to find the areas that looked similar to the text that Scoutt provided. I'm pretty sure, and I'll be corrected if I'm wrong, that the lines don't have to go into an exact spot anyway.True, but I would try to keep things together as much as possible.

Morrow, I dont' have a book to do that. :Pboastful people... perhaps you guys need to look for the word "humble" in the dictionary. Its the word that a guy name Bhudda used to start an entire religion. Not that Im Bhuddist, but its still a good principle to follow!:cool:

Anyway, On the notepad i have at home i have a Goto line function so I'll do it there! I think it may actually work with some patience!
 
Back
Top