PDA

View Full Version : php on win-one little thing..


andre
06-21-1999, 07:23 AM
Hi there,

I am a new member (as of June 16th) and tried to keep up with all the discussions from the archive. Especially of interest was the Apache,PhP,MySQL topic. Still, I couldn't find a solution for my problem.

Apache is running fine on my machine (win98), but php just doesn't seem to be working that good. I have one basic php page with the following code:
<? phpinfo(); ?>

When I try to load that into my browser, it comes up with the dialog box &quot;open it, or save to disk&quot;. I say &quot;open it&quot; and it comes up with what program to open it. So I choose Internet Explorer and it just displays the source. When I choose php.exe, a dos box opens, executes the php file and closes. Isn't it possible to have the results of my php page displayed in the browser?

Thanks for your help in advance.

Andre

Justin
06-21-1999, 09:36 AM
When the browser brings up the download dialog, this simply means that the server does not know what to do with the particular file, and neither does the browser - so it asks you.

In your httpd.conf file for Apache, make sure you have these lines:

ScriptAlias /php3 &quot;c:/php3&quot;

AddType application/x-httpd-php3 .php3 .php
AddType application/x-httpd-php3-source .phps

Action application/x-httpd-php3[nbsp][nbsp][nbsp][nbsp][nbsp]/php3/php.exe
Action application/x-httpd-source /php3/php.exe

The first line tells Apache that you want localhost/php3 to poing to c:/php3 (or wherever you installed php's exe and DLL files). The rest tells Apache that all PHP files are to be sent to /php3/php.exe - that would be the URL of http://localhost/php3/php.exe - basically, since we are in Windows it is running as though it were a script.

So it's not quite the same as it is on the server, but it works well for me.

<font color=#FF0000>Note:</font> Make sure you use forward (Unix-like) slashes on all paths, never back (DOS like) slashes.

Hope this helps :)
[nbsp]
------------------
Justin Nelson
FutureQuest Support

andre
06-21-1999, 11:52 AM
Thank you, thank you thank you and an additional thank you for that :)

Action application/x-httpd-php3[nbsp][nbsp][nbsp][nbsp] /php3/php.exe
Action application/x-httpd-source /php3/php.exe

That did it for me. And I must say, I love my new coding environment!

Great. Thanks again!