# What's with PHP's newfound obesity?

## Target

While trying to figure out what put java into my update cycle, I seem to have found the culprit: PHP

...and java's not the only thing.

I do an emerge --pretend -u php and get:

Calculating dependencies ...done!

[ebuild  N   ] dev-java/java-config-0.2.2 to /

[ebuild  N   ] dev-java/blackdown-jdk-1.3.1-r5 to /

[ebuild  N   ] media-libs/pdflib-4.0.1-r3 to /

[ebuild  N   ] x11-libs/qt-3.0.3-r1 to /

[ebuild  N   ] dev-libs/libmcrypt-2.4.19 to /

[ebuild    U ] dev-lang/php-4.1.2-r8 to /

This is nuts! What does qt have to do with php that makes it a dependency?

PHP ran just fine without java, pdflib or libmcrypt, so I'm not sure why it seems to need those either...

None of these things are even in my USE variable.

Sure, I'll go put -java -qt -pdf in there now, but lean&mean by default would have been preferrable.  If I wasn't in the habit of using --pretend on my low-headroom system, that would have been an unexpected kick in the teeth from portage.

Maybe portage could have an option added where when you install packages that are optional dependencies of others, it can ask if you want to add them to your USE variable and rebuild packages that can make use of them.

----------

## fuji

 *Target wrote:*   

> While trying to figure out what put java into my update cycle, I seem to have found the culprit: PHP
> 
> ...and java's not the only thing.
> 
> I do an emerge --pretend -u php and get:
> ...

 

Well i think that the pdflib was installed, because php has built in functions to read/write/access pdf files.  The same goes for libmcrypt.  Those functions are built in (i belive mcrypt_cfb() and/or mcrypt_cbc() and one other that i don't know....  qt is a library that php uses for something... i've seen it on a lot of php info pages....  I don't know what it's for, but my guess is it's to satisfy a built in function as well.

As for java... well i have never used java in php, so i don't know why... hehe.... there's probably some relation to satisfy some secret function that only a few people use.... 

Hope this helps

----------

## rizzo

 *fuji wrote:*   

> As for java... well i have never used java in php, so i don't know why... hehe.... there's probably some relation to satisfy some secret function that only a few people use.... 
> 
> 

 

You can instantiate java objects in PHP.  Although I've never done it, I can see it's usefulness.  Although if you were using java objects, why not just use JSPs to serve up the webpages?  Anyway just thought I'd comment.

Cheers.

----------

## Utoxin

I noticed the same thing, but my PHP wouldn't even compile with Java turned on in it. I had to add the -java to my use setting while I emerged it, then turn it back on. (I do use it elsewhere.)

----------

## Guest

Well, I am glad it wasn't only me who noticed this....I was a little worried that something was wrong for a moment.

----------

## shawncorn

But what's with the xfree86 and opengl depends?  

```

[ebuild  N   ] x11-base/opengl-update-1.3 to /

[ebuild  N   ] x11-base/xfree-4.2.0-r12 to /

```

(Hey, it's my first post! =)

*cough* OK Second post.  But c'mon, /dev/null doesn't count.

----------

## mksoft

 *shawncorn wrote:*   

> But what's with the xfree86 and opengl depends?

 

I guess that since qt is included it includes opengl as well. But this is exactly what the USE var is for. The default is to build with everything and users can define their own setup.

Don't want php to build with java, qt, postgresql and whatever else, set the use var prior to emerging php, fo example:

```
USE="-qt -java -opengl -gd -pdflib -X -postgresql"  emerge -p php
```

You should refer Gentoo Guide to USE flags and Gentoo Linux Developers HOWTO for complete USE options list.

You can also refer to php's ebuild to see the dependencies. eg:

```
DEPEND=">=dev-libs/gmp-3.1.1

        ~media-libs/freetype-1.3.1

        >=media-libs/jpeg-6b

        >=media-libs/tiff-3.5.5

        >=media-libs/libpng-1.2.1

        >=media-libs/libgd-1.8.3

        >=media-libs/t1lib-1.3.1

        >=net-www/apache-1.3.24-r1

        X? ( virtual/x11 )

        qt? ( =x11-libs/qt-2.3* )

        nls? ( sys-devel/gettext )

        pam? ( >=sys-libs/pam-0.75 )

        xml? ( >=app-text/sablotron-0.44 )

        ssl? ( >=dev-libs/openssl-0.9.5 )

        curl? ( >=net-ftp/curl-7.8.1 )

        snmp? ( >=net-analyzer/ucd-snmp-4.2.3 )

        imap? ( >=net-mail/uw-imap-2001a-r1 )

        gdbm? ( >=sys-libs/gdbm-1.8.0 )

        ldap? ( >=net-nds/openldap-1.2.11 )

        odbc? ( >=dev-db/unixODBC-1.8.13 )

        xml2? ( dev-libs/libxml2 )

        crypt? ( >=dev-libs/libmcrypt-2.4

        >=app-crypt/mhash-0.8 )

        mysql? ( >=dev-db/mysql-3.23.26 )

        flash? ( media-libs/libswf >=media-libs/ming-0.2a )

        berkdb? ( >=sys-libs/db-3 )

        libwww? ( >=net-libs/libwww-5.3.2 )

        firebird? ( >=dev-db/firebird-1.0 )

        pdflib? ( >=media-libs/pdflib-4.0.1-r2 )

        postgres? ( >=dev-db/postgresql-7.1 )"

#       java? ( virtual/jdk )

# Only needed by CGI-Version

#       readline? ( >=sys-libs/ncurses-5.1

#               >=sys-libs/readline-4.1 )"

```

Those marked with ? are optional and can be changed with USE.

----------

## Ian Goldby

Ok, but is there a way to define application-specific USE settings? What about if you later do an emerge update world?

----------

## mksoft

You can set those before you emerge the package:

```
USE="-qt -X" emerge php
```

As for later when you emerge world, it is up to you to take care of that if those use flags are not in your make.conf.

I never do emerge -u world. I usally do emerge -up world and from the output decide what I want to upgrade, as I custimize a lot. Ahh, the life of a Gentoo users  :Wink: 

The effective USE flags used while emerging a package (among the rest of ebuild info) is recorded, and can help.

It's stored under /var/db/pkg/<package section>/<package_name>/USE

----------

## Ferdy

QT is needed for the qtdom functions in PHP.

Just my 2 cents

----------

