# apache + php + mysql

## bemixam

i have a server running with Apache and PHP

i want too add mysql

after a emerge mysql ...

it seem dont work

when i do a phpinfo(), i can see the flag " '--without-mysql'"

what can i do ?

i think that i have to recompile apache with the flag with_mysql but how ?

----------

## mksoft

You'll need to recompile php and make sure mysql is in your USE flags.

To learn more about USE flags see this.

----------

## bemixam

i add mysql in my USE variable

i have to recompile apache ? only php ?

how can i recpompile it ?

----------

## mksoft

You'll only need to recompile php. Simply emerge it again.

----------

## bemixam

ok thanks

----------

## mksoft

You're welcome  :Smile: 

Just don't forget to restart apache after emerge php and before testing it with phpinfo().

----------

## bemixam

hum hum .... i have rescompiled 3 times php ....

but it still dont works .... have i somethings else to do ?

----------

## mksoft

What doesn't work, can you be more specific  :Question: 

USE flags  :Question: 

Do you have mysql emerged  :Question: 

Are you emerging php or mod_php  :Question: 

----------

## bemixam

i emerged php ( so it emerge apache automatically )

then i want to had mysql

so i type emerge mysql

it install mysql

mysql is running ...

but i realized that php wasen t compiled with mysql support

so i do  "emerge php" again ....

but php steel "without mysql" compiled

my USE variable is : USE="mysql samba imap"

of course i edited  /etc/make.conf before re-emerge php

question : after  mysql installation, it is not necessary to add mysql in my USE var ... because i suppose that gentoo add automaticaly the emerged thing in the USE var ...... am i right ?

----------

## mksoft

Should be.

You should emerge mod_php (not php). as of one week ago php is a standalone/cgi binary ebuild.

mod_php is the one used with apache. If you emerge php it won't have any effect on the module loaded with apache (which you've already compiled).

----------

## bemixam

so i have to unmerge php

 and emerge mod_php ?

----------

## mksoft

Yes, it is advised (unless you want php binary as well).

----------

## al3x

It seems I'm the "alternative" guy tonight   :Wink:   Even though it may not fit the nice Gentoo portage easy-upgrade thing, you can try Apache Toolbox (http://www.apachetoolbox.com/), which will pull down Apache, PHP, and other mods and build it all for ya (with or without mysql support).  So you could emerge mysql, then rock Apache Toolbox.  Just a thought.

----------

## styzzo

 *al3x wrote:*   

> then rock Apache Toolbox

 

I'm of the opinion that lots of things can be 'rocked'. That made me laugh  :Smile: 

----------

