# PHP, why do i need Xfree ?

## jon

Hi,

I'd like to build a gentoo server, but I do not have so much hard drive space. so I do not want to install other apps like xfree

but when I try a "emerge -p php" it says that it need to emerge xfree too !

how can I emerge php without merging xfree ? should I set something in the USE variable in make.conf ?

thanks

jon

----------

## Beforegod

```

export USE="-pdflib -X"

```

try this and look if php requires X  :Wink: 

----------

## jon

thanks,

now, maybe you know what sould I set in my USE to have a good firewall, nat router, with samba apache php and mysql ???

jon

----------

## humpback

I have 

```
USE="imap mysql  -opengl -gtk2 -gnome -alsa -qt -X"
```

.

Try not adding the -pdflib and see if php still requires X. Pdflib allows you to creat pdf files on the fly from php (not very used but.....).

----------

## SouthOfHeaven

i did a USE="-pdflib -X" emerge -up mod_php and it still shows X11 packages

----------

## pjp

Does this thread help?

----------

## SouthOfHeaven

yep thank you that did the trick

the

```
USE="-*" emerge -up mod_php
```

worked out great  :Very Happy: 

----------

## guero61

For further documentation, here's my minimalistic server's USE statement:

```

USE="-X -truetype -pdflib -qt -java -gtk -gnome -3dnow -kde -alsa"

```

Yes, I disabled java; I'll never write any java to run on the machine, and I'm only using the occasional PHP/Perl CGI, so It's all good.  w00t!

----------

## wolf31o2

I have found that my new secret to USE on all my machines is to make them all look like this:

USE="-* use1 use2 use3" supplying only the use variables I definitely want.  This makes for a much cleaner Gentoo build IMO.

For example, on my firewall, I have USE="-* apm crypt ethereal gpm ipv6 mmx ncurses pam perl pic python samba ssl tcpd zlib"

----------

## pipan

I hope someone will save some time on this tips. If you use apache2 you must 

```
USE="-* apache2" emerge mod_php
```

 If you dont do that the ebuild will search for /usr/sbin/apxs instead of /usr/sbin/apxs2 that it should be.

----------

## carpman

Hello just curious about this:

```

USE="-*

```

Does this disable the default USE flags or just prevents other being included unless added to USE=

cheers

----------

## devon

It will disable ALL USE flags.

No USE flags:

```
# USE="-*" emerge -pv apache

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

Calculating dependencies ...done!

[ebuild  N    ] net-www/apache-2.0.50  -berkdb -debug -doc -gdbm -ipv6 -ldap -ssl -static -threads  6,197 kB

Total size of downloads: 6,197 kB
```

Standard USE flags:

```
# emerge -pv apache

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

Calculating dependencies ...done!

[ebuild  N    ] net-www/apache-2.0.50  +berkdb -debug -doc +gdbm -ipv6 -ldap +ssl -static -threads  6,197 kB

Total size of downloads: 6,197 kB
```

My make.conf to show that I do not explicitly set +ssl, +berkdb, or +gdbm.

```
# grep USE /etc/make.conf

# The USE variable is used to enable optional build-time functionality. For

# very extensive set of USE variables described in our USE variable HOWTO at

#USE="X gtk gnome -alsa"

USE="-cups -voodoo3 -3dfx -gnome jabber"
```

----------

## nobspangle

Two things

the reason php wants to install X is because of qt you need -qt as a use variable.

Second is the prefered way of specifying per package use variables has changed. Create a file

/etc/portage/package.use

(you will have to create the directory if it doesn't already exist)

in that file specify packages and their use flags

```
net-www/apache ssl threads -docs

net-fs/samba cups ldap mysql
```

That way when you do emerge -uD world the packages will retain their use flags.

----------

## buzman

I've found that for some reason the postgresql use variable is the culprit. 

Just add -postgres to your /etc/make.conf (assuming of course that you don't need it!) and all the X dependencies disappear.

----------

## vord

someone looking at this might need to do USE="-xpm" in order to avoid installing X when merging PHP.... thats how i solved it.

--vord

----------

