# [SOLVED] lighttpd pulling in apache2?

## slackline

Hi,

I went to install www-servers/lighttpd yesterday and wanted to include php support so set my USE flags only to be told that virtual/httpd-php-5.3 requires dev-lang/php-5.3* needs to be built with USE=apache2 which of course pulls in www-servers/apache which I don't want to install because I'm trying to install the lighter www-servers/lighttpd !!!

```

# echo 'www-servers/lighttpd fastcgi php' >> /etc/portage/package.use

# emerge -atv lighttpd

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy "=dev-lang/php-5.3*[apache2]".

!!! One of the following packages is required to complete your request:

- dev-lang/php-5.3.3-r1 (Change USE: +apache2)

(dependency required by "virtual/httpd-php-5.3" [ebuild])

(dependency required by "www-servers/lighttpd-1.4.26-r1" [ebuild])

(dependency required by "lighttpd" [argument])

# USE="apache2 gd" emerge -avt lighttpd

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!

[ebuild  N    ] www-servers/lighttpd-1.4.26-r1  USE="bzip2 -doc -fam fastcgi gdbm ipv6 -ldap -lua -memcache -minimal -mysql pcre php* -rrdtool ssl -test -webdav -xattr" 0 kB

[ebuild  N    ]  virtual/httpd-php-5.3  0 kB

[ebuild  N    ]   dev-lang/php-5.3.3-r1  USE="(-adabas) apache2 -bcmath berkdb (-birdstep) bzip2 -calendar -cdb -cgi -cjk cli -concurrentmodphp crypt ctype -curl -curlwrappers -db2 (-dbmaker) -debug -doc -embed (-empress) (-empress-bcs) -enchant (-esoob) exif fileinfo filter (-firebird) -flatfile -fpm (-frontbase) -ftp gd -gd-external gdbm -gmp hash iconv -imap -inifile -interbase -intl -iodbc ipv6 json -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysql -mysqli -mysqlnd nls -oci8 -oci8-instant-client -odbc -pcntl -pdo phar -pic posix -postgres -qdbm readline -recode -sapdb session -sharedext -sharedmem simplexml -snmp -soap -sockets (-solid) spell sqlite -sqlite3 ssl -suhosin (-sybase-ct) -sysvipc -threads -tidy tokenizer truetype unicode -wddx xml xmlreader -xmlrpc xmlwriter -xpm -xsl -zip zlib" 10,422 kB

[nomerge      ] dev-lang/php-5.3.3-r1  USE="(-adabas) apache2 -bcmath berkdb (-birdstep) bzip2 -calendar -cdb -cgi -cjk cli -concurrentmodphp crypt ctype -curl -curlwrappers -db2 (-dbmaker) -debug -doc -embed (-empress) (-empress-bcs) -enchant (-esoob) exif fileinfo filter (-firebird) -flatfile -fpm (-frontbase) -ftp gd -gd-external gdbm -gmp hash iconv -imap -inifile -interbase -intl -iodbc ipv6 json -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysql -mysqli -mysqlnd nls -oci8 -oci8-instant-client -odbc -pcntl -pdo phar -pic posix -postgres -qdbm readline -recode -sapdb session -sharedext -sharedmem simplexml -snmp -soap -sockets (-solid) spell sqlite -sqlite3 ssl -suhosin (-sybase-ct) -sysvipc -threads -tidy tokenizer truetype unicode -wddx xml xmlreader -xmlrpc xmlwriter -xpm -xsl -zip zlib" 

[nomerge      ]  app-text/aspell-0.60.6-r2  USE="-examples nls" LINGUAS="-af -be -bg -br -ca -cs -cy -da -de -el -en -eo -es -et -fi -fo -fr -ga -gl -he -hr -is -it -la -lt -nl -no -pl -pt -pt_BR -ro -ru -sk -sl -sr -sv -uk -vi" 

[ebuild  N    ]   app-dicts/aspell-en-6.0.0  0 kB

[ebuild  N    ]    app-text/aspell-0.60.6-r2  USE="-examples nls" LINGUAS="-af -be -bg -br -ca -cs -cy -da -de -el -en -eo -es -et -fi -fo -fr -ga -gl -he -hr -is -it -la -lt -nl -no -pl -pt -pt_BR -ro -ru -sk -sl -sr -sv -uk -vi" 0 kB

[ebuild  N    ]  www-servers/apache-2.2.16  USE="-debug -doc -ldap (-selinux) ssl -static -suexec -threads" APACHE2_MODULES="actions alias -asis auth_basic -auth_digest authn_alias authn_anon -authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache -cern_meta cgi cgid -charset_lite dav dav_fs dav_lock -dbd deflate dir disk_cache -dumpio env expires ext_filter file_cache filter headers -ident -imagemap include info log_config -log_forensic logio mem_cache mime mime_magic negotiation -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http rewrite setenvif speling status -substitute unique_id userdir usertrack -version vhost_alias" APACHE2_MPMS="-event -itk -peruser -prefork -worker" 4,726 kB

[ebuild  N    ]   app-admin/apache-tools-2.2.16  USE="ssl" 0 kB

[ebuild  N    ]  app-admin/php-toolkit-1.0.2  0 kB

[ebuild  N    ]  dev-libs/oniguruma-5.9.2  528 kB

[ebuild  N    ]  dev-libs/libmcrypt-2.5.8-r2  0 kB

Total: 10 packages (9 new, 1 reinstall), Size of downloads: 15,675 kB

Would you like to merge these packages? [Yes/No] n

```

I shouldn't have to emerge a package I don't want to use!

Further, I have another very similar Gentoo system where I have already installed lighttpd with USE="php" and it hasn't pulled in apache either on the initial install or during updates...

```

# eix lighttpd 

[I] www-servers/lighttpd

     Available versions:  1.4.23 1.4.25 1.4.25-r1 (~)1.4.26 1.4.26-r1 {bzip2 doc fam fastcgi gdbm ipv6 ldap lua memcache minimal mysql pcre php rrdtool ssl test webdav xattr}

     Installed versions:  1.4.26-r1(08:56:29 15/07/10)(bzip2 fastcgi gdbm ipv6 pcre php ssl -doc -fam -ldap -lua -memcache -minimal -mysql -rrdtool -test -webdav -xattr)

     Homepage:            http://www.lighttpd.net/

     Description:         Lightweight high-performance web server

# eix dev-lang/php

[I] dev-lang/php

     Available versions:  (5) 5.2.13 5.2.14 (~)5.3.3-r1

   {adabas apache2 bcmath berkdb birdstep bzip2 calendar cdb cgi cjk (+)cli concurrentmodphp crypt (+)ctype curl curlwrappers db2 dbase dbmaker debug discard-path doc embed empress empress-bcs enchant esoob exif fastbuild fdftk +fileinfo (+)filter firebird flatfile force-cgi-redirect fpm frontbase ftp gd gd-external gdbm gmp (+)hash (+)iconv imap inifile interbase intl iodbc ipv6 java-external (+)json kerberos kolab ldap ldap-sasl libedit mcve mhash msql mssql mysql mysqli mysqlnd ncurses nls oci8 oci8-instant-client odbc pcntl (+)pcre pdo +phar pic (+)posix postgres qdbm readline recode (+)reflection sapdb (+)session sharedext sharedmem (+)simplexml snmp soap sockets solid spell (+)spl sqlite sqlite3 ssl suhosin sybase sybase-ct sysvipc threads tidy (+)tokenizer truetype unicode wddx (+)xml (+)xmlreader xmlrpc (+)xmlwriter xpm xsl yaz zip zlib}

     Installed versions:  5.3.3-r1(5)(15:32:40 12/08/10)(berkdb bzip2 cgi cli crypt ctype exif fileinfo filter gd gdbm hash iconv ipv6 json nls phar posix readline session simplexml spell sqlite ssl tokenizer truetype unicode xml xmlreader xmlwriter zlib -adabas -apache2 -bcmath -birdstep -calendar -cdb -cjk -concurrentmodphp -curl -curlwrappers -db2 -dbmaker -debug -doc -embed -empress -empress-bcs -enchant -esoob -firebird -flatfile -fpm -frontbase -ftp -gd-external -gmp -imap -inifile -interbase -intl -iodbc -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysql -mysqli -mysqlnd -oci8 -oci8-instant-client -odbc -pcntl -pdo -pic -postgres -qdbm -recode -sapdb -sharedext -sharedmem -snmp -soap -sockets -solid -sqlite3 -suhosin -sybase-ct -sysvipc -threads -tidy -wddx -xmlrpc -xpm -xsl -zip)

     Homepage:            http://php.net/

     Description:         The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs.

```

Not sure whether to file a bug on this or how to phrase it if it is indeed a bug that needs reporting.

Any thoughts appreciated,

Cheers,

slack

----------

## slackline

 *tomk wrote:*   

> You have apache2 in your php USE flags.

 

Err, yes, because if I enable 'USE="php" emerge -av www-servers/lighttpd'  (i.e. enable PHP support when trying to emerge lighttpd) I'm told that I need to emerge php with USE="apache2".

To compare, BEFORE enabling USE="php" for lighttpd

```

# emerge -pv lighttpd

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] www-servers/lighttpd-1.4.26-r1  USE="bzip2 -doc -fam fastcgi gdbm ipv6 -ldap -lua -memcache -minimal -mysql pcre -php -rrdtool ssl -test -webdav -xattr" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

```

I don't currently have PHP installed yet, so I enable the USE="php" when emerging lighttpd as that is the server I wish to have PHP support for...

```

# USE="php" emerge -pv lighttpd

These are the packages that would be merged, in order:

Calculating dependencies... done!

emerge: there are no ebuilds built with USE flags to satisfy "=dev-lang/php-5.3*[apache2]".

!!! One of the following packages is required to complete your request:

- dev-lang/php-5.3.3-r1 (Change USE: +apache2)

(dependency required by "virtual/httpd-php-5.3" [ebuild])

(dependency required by "www-servers/lighttpd-1.4.26-r1" [ebuild])

(dependency required by "lighttpd" [argument])

```

I do NOT have USE=apache set in either /etc/make.conf or /etc/portage/package.use as the following shows...

```

# emerge --info | grep apache

# grep apache /etc/portage/package.use 

#

```

So I started routing through the dependency tree and it looks like its virtual/httpd-php-5.3 that is guilty of forcing dev-lang/php-5.3* to be built with USE="apache2" as this shows...

```

# grep apache /usr/portage/virtual/httpd-php/httpd-php-5.3.ebuild 

RDEPEND="|| ( =dev-lang/php-5.3*[apache2]

# grep apache /usr/portage/www-servers/lighttpd/lighttpd-1.4.26-r1.ebuild 

#

```

So its a case of..

1. Enable USE="php" for www-servers/lighttpd-1.4.26-r1 and it pulls in virtual/httpd-php-5.3

2. virtual/httpd-php-5.3 requires that dev-lang/php-5.3* be buillt with USE="apache2"

...which shouldn't be the case should it?

Or have I completely mis-understood things?

Cheers,

slack

----------

## tomk

 *slack---line wrote:*   

>  *tomk wrote:*   You have apache2 in your php USE flags. 

 

And there I was hoping you wouldn't spot my stupid mistake by not reading your post correctly, and hence the ninja deletion of my post.

 *slack---line wrote:*   

> 
> 
> ```
> 
> # grep apache /usr/portage/virtual/httpd-php/httpd-php-5.3.ebuild 
> ...

 

If you look at the rest of the virtual/httpd-php-5.3 ebuild you will see that in needs php to be built with apache2 or cgi or fpm USE flags, so you probably want to add cgi to your php USE flags.

----------

## slackline

Sorry, no harm meant, just that I realised my original post may not have been clear as I'd included details of a second system where I had sucessfully installed  lighttpd with USE=php and not needed to add the USE=apache2 for dev-lang/php.  Anyway, even writing that is potentially confusing to anyone reading this in the future!

You're correct enabling USE="cgi" for dev-lang/php does indeed solve this problem.

Its slightly misleading of Portage to say that only one of the three possible RDEPEND's are required though?  Admittedly I should have looked at the ebuild more thoroughly, but it would perhaps be useful if all possible options were thrown up.

Worth submitting a bug report for?

Thanks for the solution though, 

slack

----------

## tomk

 *slack---line wrote:*   

> Sorry, no harm meant, just that I realised my original post may not have been clear as I'd included details of a second system where I had sucessfully installed  lighttpd with USE=php and not needed to add the USE=apache2 for dev-lang/php.  Anyway, even writing that is potentially confusing to anyone reading this in the future!

 

It was perfectly clear I just didn't read it correctly  :Smile: 

 *slack---line wrote:*   

> 
> 
> You're correct enabling USE="cgi" for dev-lang/php does indeed solve this problem.
> 
> Its slightly misleading of Portage to say that only one of the three possible RDEPEND's are required though?  Admittedly I should have looked at the ebuild more thoroughly, but it would perhaps be useful if all possible options were thrown up.
> ...

 

AFAIK Portage will pick the first option for dependency resolution but I wouldn't be surprised if someone had already files an enhancement request for this. This tracker bug might be a good place to start looking.

 *slack---line wrote:*   

> Thanks for the solution though, 
> 
> slack

 

No problems.

----------

## slackline

Will have a riffle through those bugs and see if anything covers this sort of situation.

Thanks again,

slack

----------

