The following applies to Unix:

If you are crazy and DO decide to compile Apache with php4 (with mysql support) and mod_perl (as a DSO), make damn sure you use your own mysql library and header files. If you installed mysql from binary or source rpms, the required files are in /usr/include/mysql and /usr/lib/mysql, so you tell php:
./configure --with-mysql='/usr'

and it's able to find everything it needs. If you use the mysql headers/libs included with the php source, you may witness unexplainable segfaults when trying to use modperl DBI connects to a mysql server. Here's my build script in case you're interested...
#!/bin/sh # # build_apache.sh # # -------install Apache using DSOs-------- # # first, untar apache, mod_perl, and php in a common dir. # my tree looks like this: # /tmp/apache # | # ./apache_1.3.14/ # ./apache_1.3.14.tar.gz # ./build_apache.sh # ./mod_perl-1.24/ # ./mod_perl-1.24.tar.gz # ./php-4.0.3pl1/ # ./php-4.0.3pl1.tar.gz ########################################################### # prebuild apache for php cd apache_1.3.14 rm -rf config.cache make clean ./configure --prefix='/usr/local/apache' cd .. ########################################################### # build php cd php-4.0.3pl1 rm -rf config.cache make clean ./configure --with-mysql='/usr' --enable-track-vars \ --with-apache='../apache_1.3.14' # mysql header files in /usr/include/mysql # mysql library files in /usr/lib/mysql # (this is the default from an rpm install of mysql) make make install cd .. ########################################################### # build mod_perl cd mod_perl-1.24_01 rm -rf config.cache make clean perl Makefile.PL \ APACHE_PREFIX='/usr/local/apache' \ APACHE_SRC='../apache_1.3.14' \ NO_HTTPD=1 \ USE_APACI=1 \ PREP_HTTPD=1 \ EVERYTHING=1 make make install cd .. ########################################################### # build apache cd apache_1.3.14 rm -rf config.cache make clean ./configure --prefix='/usr/local/apache' \ --enable-module=rewrite \ --enable-module=proxy \ --activate-module='src/modules/perl/libperl.a' \ --activate-module='src/modules/php4/libphp4.a' \ --enable-shared=perl make make install cd .. ########################################################### # fin

In reply to compiling apache with mod_perl (DSO) and php4 by meonkeys
in thread Combining PHP and Perl by rodry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.