PHP5 and Apache2

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
sebdah
Forum Newbie
Posts: 2
Joined: Wed Oct 26, 2005 4:23 am

PHP5 and Apache2

Post by sebdah »

Hi!
I want to compile PHP5 (with MySQL) for Apache2 on my Mac OS X. I've
compiled everything now. But I can't find any info on what to print in
my httpd.conf.

Dirs:
/usr/local/mysql
/usr/local/php5
/usr/local/apache2

In my /usr/local/apache2/conf/httpd.conf I added:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

But I guess I need to add something to load php5. I tried:

LoadModule php5_module /etc/httpd/libexec/httpd/libphp5.so

But it didn't load successfully..

Thanks in advance
Sebastian Dahlgren, Sweden
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Hi,

I can't be of much help other than provide the link to the mac os x install page on php.net:

http://www.php.net/manual/en/install.macosx.php

:)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Web Servers.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Did you compile php "--with-apxs2=/path/to/the/apxs/binary" ? That should put the line in httpd.conf for you. I guess you can do that with the mac version too. To use that you need to compile apache "--with-apxs" ;)

apxs is usally in the same dir as apachectl.
sebdah
Forum Newbie
Posts: 2
Joined: Wed Oct 26, 2005 4:23 am

Post by sebdah »

Yeah I used --with-apxs2=/usr/local/apache2/bin/apxs

Still no lines
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Can you post the relevant parts of your httpd.conf.

apxs usually adds the line for the php5 module right down at the bottom of the list of modules to load-in.

Code: Select all

# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
LoadModule php5_module        modules/libphp5.so
That's from the httpd.conf on my laptop (as you can see, I don't have many modules loaded into apache on my laptop :P).

apxs put that line there for me though ;)
Post Reply