views:

253

answers:

6

Hello!

I'm trying to setup an Apache/PHP/Postgresql server locally on my machine. I tried to install everything manually (one thing at a time) and after I get everything up and running, whenever I try to run a script on my machine, I get a "What do you want to do with the *.php file?" dialog.

NOTE: the dialog is the browser's open/save dialog

NOTE2: i'm just trying to get the output of phpinfo() to make sure everything is up and running...

I already tried to mess around a bit with the Apache conf file, but since I don't know much about what I'm doing, I reinstalled everything again and the problem is still there. I kinda get the feeling it must have something to do with the PHP thingy isn't correctly installed.

OK: i'll try to rephrase everything: i'm using Windows vista business 32bit. I tried installing each application's standalone, apache, postgresql and php (all the latest stable releases). when i try to get the output of phpinfo as in:



I get the browser's "Open/Save" dialog for the *.php file

that's it I guess... if I forgot something, please ask

thanks for your help

+4  A: 

You should have something like this in your httpd.conf file:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/php"

Make sure that's in place, and don't forget to restart apache!

In Windows, the default location for your conf file is C:\Program Files\Apache Group\Apache2\conf\httpd.conf

Greg
I did what you said, but I still don't think it's working... now I'm trying to get the output of the phpinfo function and nothing appears...
Joum
Hmmm... you shouldn't get "nothing"... Check your apache error logs
Greg
A: 

are you on Windows?

I use Wamp server, which is an excellent way of getting Apache, MySQL and PHP installed and configured without any hassle on Windows.

If you want to use Postgres instead, provided that you've got it installed separately it will work fine. (one great thing you can do with Wamp is add and remove PHP extensions via a GUI pretty much on-the-fly, and pgsql is one of them).

Phill Sacre
A: 

Maybe somebody can help, but you'd be much better off if you'd provide some relevant details.

What sort of system are you using? Be specific.

What do you mean by "everything up and running"?

What are you doing when you "try to run a script"?

What installation procedures did you use? (If you were following them off a script or how-to, we at least need to know where to find the script or how-to.)

We don't automatically know these things. What seems obvious to you may not be clear to us, and what seems irrelevant to you may turn out to be crucial.

David Thornley
A: 

In httpd.conf, make sure the PHP module is being loaded and that that line isn't commented out. (Comments in httpd.conf starts with #.)

Also what OS are you running?

svinto
+1  A: 

You can also have a look at the official page of PHP in the install section.

There is a closer link if you are on Windows.

And you can also use some precompiled installer for this like XAMMP and install Postgres after all is set up and running with the web server and php.

Biri
A: 

I had the same problem, You need to configure apache and add the php module... e.g I compiled the php from source as well as the apache. After doing so I then copied the libphp5.so from php/lib dir in to the apache/modules dir. Than you have to add php in the http.conf

LoadModule php5_module modules/libphp5.so

AddHandler php5-script php

you can then restart apache....it's not the most elegant of solutions but it works.

Ronald Conco