# Apache-php-mySQL  how-to / install guide?

## aminal

I've been searching around and haven't found any kind of install guide for building apache with mysql and php support.  I've been reading various posts with people having issues with one of these 3 and getting them to interact correctly, but nothing really that says "do this, and this."  Once I get everything installed and working correctly I plan to write a how-to, but I need to get there first.  That being said:

What would be best way to go about getting these three installed and working together?  emerging apache2, then mod_php then mysql?  or maybe apache2 first, them mysql then php?  Are there any switches needed when emerging to get them to work together correctly?   Like telling apache2 to emerge with php and mysql support, or does that come with installing mod_php and mysql anyway?

Thanks!

**edit***

Didn't look far enough back, got some good info - thanks!

----------

## neysx

```
USE="apache2 mysql" emerge -vp mod_php
```

 Add any other options you are interested in and emerge. Edit your /etc/make.conf to make your options persistent.

Hth.

----------

## alexf

aminal, I am looking for exactly the same thing. I have already emerge'd apache and php, but now wish to add mysql to use with both - do I need to add msql to my USE variables and re-emerge apache and php or can I just emerge mysql?

----------

## neysx

Use etcat -u to view what USE flags have been used to compile already installed packages. It is likely that mod_php was compiled without mysql support. You will have to emerge it again. Apache does not have any mysql USE flag, so it's probably already properly compiled.

```
etcat -u mod_php

[ Colour Code : set unset ]

[ Legend   : (U) Col 1 - Current USE flags        ]

[          : (I) Col 2 - Installed With USE flags ]

 U I [ Found these USE variables in : dev-php/mod_php-4.3.5 ]

 + + apache2     : Chooses Apache2 support when a package supports both Apache1 and Apache2

 + + X           : Adds support for XFree86

 - + crypt       : Add support for encryption -- using mcrypt or gpg where applicable

 + + curl        : Adds support for client-side URL transfer library

 - - firebird    : Adds support for the Firebird relational database

 - - flash       : Adds support for creating flash files using Ming

 - - freetds     : Adds support for the TDS protocol to connect to MSSQL/Sybase databases

 + + gd          : Adds support for media-libs/libgd (to generate graphics on the fly)

 - - gd-external : Use the external version of libgd rather than the bundled one (possibly dangerous)

 + + gdbm        : Adds support for sys-libs/gdbm (GNU database libraries)

 + + imap        : Adds support for IMAP

 - - informix    : Adds support for Informix database

 - - ipv6        : Adds support for IP version 6

 + + java        : Adds support for Java

 + + jpeg        : Adds JPEG image support

 - - ldap        : Adds LDAP support (Lightweight Directory Access Protocol)

 - - mcal        : Adds support for MCAL calender system

 - - memlimit    : Adds memory usage limiting in supporting programs

 + + mysql       : Adds mySQL support

 + + nls         : unknown

 - - oci8        : Adds Oracle Support

 - - odbc        : Adds ODBC Support (Open DataBase Connectivity)

 + + pam         : Adds support PAM (Pluggable Authentication Modules)

 + + pdflib      : Adds support for PDF (Portable Document Format)

 + + png         : Adds support for libpng (PNG images)

 - - postgres    : Adds support for the postgresql database

 - - qt          : Adds support for the Qt library.

 - - snmp        : Adds support for the Simple Network Management Protocol if available

 + + spell       : Adds dictionary support

 + + ssl         : Adds support for Secure Socket Layer connections

 + + tiff        : Adds support for the tiff image format

 + + truetype    : Adds support for FreeType and/or FreeType2 fonts

 + + xml2        : Check/Support flag for XML library (version 2)

 - - yaz         : Adds in optional support for the Z39.50 Protocol for Information Retrieval (YAZ)

 - - fdftk       : Add supports for Adobe's FDF toolkit.

 + + doc         : Adds extra documentation (API, Javadoc, etc)

 - - gmp         : Adds support for dev-libs/gmp (GNU MP library)

 + + berkdb      : Adds support for sys-libs/db (Berkeley DB for MySQL)
```

----------

## req

Hello

 *Quote:*   

> Use etcat -u to view what USE flags have been used to compile already installed packages. 

 

That is, indeed a very interesting feature! I want it, but I dont seem to have any program named etcat, and I cant find it with emerge search etcat, so where do I get it?

----------

## neysx

It's part of gentoolkit along with other goodies.

```
 $ emerge -vp gentoolkit

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild   R   ] app-portage/gentoolkit-0.2.0_pre8   0 kB 

Total size of downloads: 0 kB
```

```
 $ qpkg -l gentoolkit

app-portage/gentoolkit-0.2.0_pre8 *

CONTENTS:

/usr

/usr/bin

/usr/bin/euse

/usr/bin/qpkg

/usr/bin/etcat

/usr/bin/revdep-rebuild

/usr/bin/glsa-check

/usr/bin/dep-clean

/usr/bin/equery

/usr/bin/ewhich

/usr/bin/pkg-size

/usr/lib

...

```

Hth

----------

## t3rm1nal

what if you want to enable / disable specific apache modules for compile with the configure script - how would you go about that?

----------

## centryfox

look in the ebuild for the version you're trying to emerge.   I think there are some "USE"-like flags in that script that get used to create the config statement.   It all gets stored in a var called myconf.     If there's a better way - I don't know it yet.   

Cheers!

----------

