Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apache, PHP & Postgres Setup

Posted on 2007-03-25
7
Medium Priority
?
1,118 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 100 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 100 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

670 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