Configuring Apache 2 with PHP 5 on Mac OSX

I've just downloaded PHP5 for Mac OSX and installed it. Now I need to configure httpd.conf to work with PHP. I can take a look at the changes in the Apache 1.3 httpd.conf file, but don't know it that will do. Is there any guide that I can follow? Any lines to be added that should do the trick?
LVL 1
grexxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ronan_40060Commented:
Well
In order to enable PHP to run on Apache
To enable php on apache
Open your httpd.conf file and look for the following lines:
LoadModule php4_module  
libexec/libphp4.so
The above line loads the module.  Then you also need to have a line to tell it to process the .php file.  The line for this is:
AddType application/x-httpd-php .php
There should be sections for each of these lines.  
The AddType line is usually present, but commented (#) out.
You can also add more extensions that you want to process as well, like .php .php3 .php4 etc.
After adding these lines you need to restart your apache server.  
Good Luck
Ronan
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
grexxAuthor Commented:
You seem to point to PHP4 and I have PHP5 installed. I tried to change the 4 to a 5 but that didn't work.
0
ronan_40060Commented:
it shud have worked I am not sure why it did not work
I will check it and post u a reply
meanwhile pls check the resourses on PHP on
http://www.sitepoint.com/subcat/php-tutorials
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

grexxAuthor Commented:
It turns out that when I add the line to the config file, the server won't start anymore. In the beginning it seemed like it did when I did a restart, but in fact it turns out that most of those restarts don't work properly.
0
ronan_40060Commented:
0
grexxAuthor Commented:
I have it running! :-)

What I did was changing the config line above to

LoadModule php5_module  modules/libphp5.so

and copy the libphp5.so file into the modules folder of Apache. Still, for the hints, I give you the points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.