Solved

Apache, PHP & Postgres Setup

Posted on 2007-03-25
7
1,114 Views
Last Modified: 2013-12-13
Hi Experts,

I've been trying to install apache, php and postgresql on my mac os x and have them worked together.  My guide to this is obtained from http://developer.apple.com/internet/opensource/postgres.html .  However, I've run into problems when browsing my test php file at the address localhost/pg.php.  Instead of connecting to database and processing my page, my browser is asking me whether or not to download this file containing an application called pg.php.  So, can someone points out where i've missed.  I really need to get them working.
0
Comment
Question by:R6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 10

Accepted Solution

by:
Luxana earned 25 total points
ID: 18791905
Hi,

apache probably do not know how to handle php files yet. Look for php module for apache. I'm on linux and I got something like this:
libapache2-mod-php5 - server-side, HTML-embedded scripting language (apache 2 module)

you should look for something similar for mac.

hope this helps
0
 

Author Comment

by:R6
ID: 18798561
hi Luxana,

I have looked it up those 2 modues for apache through fink and did not find those modules..  by the way, my apache comes with the os, its precompiled.  So, what should i do now?

thanks

R6
0
 
LVL 10

Assisted Solution

by:ivanovn
ivanovn earned 25 total points
ID: 18816697
Look for the directory where your Apache resides. In that directory there is a file:
<apache_home>/conf/httpd.conf

In that file search make sure you have something like this:
AddType application/x-httpd-php .php4 .php3 .phtml .php
Action  application/x-httpd-php /cgi-bin/php.exe

This tells Apache to render the php pages (with different possible php extensions) using php. Ensure that your action line points to the correct location of your php installation.

Also, as Luxana suggested, make sure your php module is loaded. In the same configuration file check that you have something like (it will depend on your php version):
LoadModule php4_module php4apache2.dll

Also in your php.ini file, check that your extension for PostgreSQL is enabled. This would look like this:
extension=php_pgsql.dll

Good luck.




0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question