Page 1 of 1

PHP5 and Apache2

Posted: Wed Oct 26, 2005 4:25 am
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

Posted: Wed Oct 26, 2005 8:00 am
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

:)

Posted: Wed Oct 26, 2005 8:11 am
by John Cartwright
Moved to Web Servers.

Posted: Wed Oct 26, 2005 8:13 am
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.

Posted: Wed Oct 26, 2005 8:29 am
by sebdah
Yeah I used --with-apxs2=/usr/local/apache2/bin/apxs

Still no lines

Posted: Wed Oct 26, 2005 1:43 pm
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 ;)