[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

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?
0
grexx
Asked:
grexx
  • 3
  • 3
1 Solution
 
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
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now