# Installing APACHE + PHP --with options -  New to Gentoo

## pittster

Hi

I'm wondering how to add the configure options when doing an emerge? 

Is is possible? Or do you do the emerge and then recompile it afterwards with the options you would like.

For Example:

When I built apache, php from the sources this is what I did.

For apache: 

./configure \

 --with-layout=Apache \

 --enable-module=ssl     --enable-shared=ssl \

 --enable-module=rewrite --enable-shared=rewrite \

 --enable-module=proxy   --enable-shared=proxy \

 --enable-module=so

make

make install

php 

./configure --with-apxs=/usr/local/apache/bin/apxs --enable-exif \

--with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr \

--with-ttf=/usr --with-freetype-dir=/usr --with-gettext

--with-mysql=/usr/local/mysql

So If I were to do this with Gentoo and Portage, what would be the steps?

Thanks in advance.

J.

----------

## ckdake

just add what you want in your USE variable in /etc/make.conf.

I have USE="apache2 ssl php"  (and a lot more stuff) in my server, and when i do "emerge apache2"  it automagically adds ssl and php support.

then you just edit /etc/conf.d/apache2 and make sure you put in the right options for "APACHE2_OPTS"

(if you are using apache 1, just get rid of the 2 in everything i mentioned above.)

that should work like a charm.

----------

## pittster

And what about PHP?  Basically my concern is making sure that all the right options are compiled with it. 

I guess what I am wondering if there is a way to do a command sort of like:

# emerge php -options "--with gd, --with jpeg ...." 

or do you have to go to the downloaded source and recompile it there?

Do I do something like that in the USE variable?

----------

## ckdake

afik you just put things in your use variables.  I run gallery and phpsysinfo and phpicalendar and phpbb on my machine with only "php" and "apache2" and "mysql" in my USE variable.

i did emerge imagemagick (sp?) and netpbm to do some image manipulation stuff. 

But basically, i think the default options for php plus stuff in your use variable should take care of all your needs unless you are doing something pretty crazy.

----------

## Oopsz

emerge ufed

then use ufed to select what global compile-time options you want.  don't deal with --with flags ever again  :Smile: 

----------

## SubAtomic

G'day pittster.

To answer your question in a very straight forward way, from the command line you can do this ...

```
# USE="gd mysql" emerge php
```

To add more options, simply ...

```
# USE="gd mysql <another option> <another option>" emerge php
```

----------

