php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48989 --with-apxs2 and --enable-embed incompatible
Submitted: 2009-07-20 16:13 UTC Modified: 2010-11-14 00:23 UTC
From: lcoffin at cio dot com Assigned: jani (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.0 OS: Ubuntu 8.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lcoffin at cio dot com
New email:
PHP Version: OS:

 

 [2009-07-20 16:13 UTC] lcoffin at cio dot com
Description:
------------
If --with-apxs2 is included with --enable-embed then the resulting library can't be used with embedded applications. Trying to build an app (plphp-1.3.5 and plphp-1.3.3) that embeds PHP results in a number of lines like:

/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_bucket_eos_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_cleanup'
/usr/local/lib/libphp5.so: undefined reference to `ap_auth_type'

If --with-apxs2 is left off of the PHP build, the embedding app compiles just fine.

Not sure if this is a bug per-se, or a problem with not including enough libraries (the apache libs?) when compiling the embedding app, or if there needs to be a check in ./configure that flags the invalid combination and doesn't allow ./configure to complete.

But now I seem to be stuck with the problem of needing to have two "versions" of php -- compile once with --with-apxs2 and once with --enable-embed. And I'm not sure which one I should do first, which one I should do second, and what the implications are (i.e. if the CLI version of php needs to be one vs the other. Or if Apache will stop working if the --enable-embed one is the second compile.)


Reproduce code:
---------------
cd /usr/src/php-5.3.0
./configure --with-apxs2="..." --enable-embed (other options)
make && make install
cd /usr/src/plphp-1.3.5/trunk
./configure  (configure fails... config.log shows above errors)

cd /usr/src/php-5.3.0
./configure --enable-embed (other options)
make && make install
cd /usr/src/plphp-1.3.5/trunk
./configure  (succeeds)



Expected result:
----------------
Expected plphp/configure to succeed

Actual result:
--------------
plphp/configure fails with:

/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_bucket_eos_create'
/usr/local/lib/libphp5.so: undefined reference to `apr_brigade_cleanup'
/usr/local/lib/libphp5.so: undefined reference to `ap_auth_type'

... etc.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-21 12:59 UTC] jani@php.net
You can't build multiple SAPIs. You're building an Apache SAPI here. --enable-embed is simply ignored. (alphabetical order, A comes before E :)
 [2009-07-21 13:46 UTC] lcoffin at cio dot com
Sorry, I'm used to the "here's everything I want, now build it" kind of thinking -- i.e. "I want the CLI, the Apache module, and an embeddable library". This "rebuild for each use" isn't what I was expecting and seems *very* cumbersome to maintain -- I have to remember multiple sets of config options and each time I upgrade PHP I have to remember to configure/build each one. Having the ability to specify and build everything at once would be really handy.

At the very least, configure should thow a warning if not a downright error when conflicting flags are given -- *something* to indicate it's not going to do what it's been asked to do. It would have saved me a *ton* of wasted time trying to figure this out. I'm old school enough -- I've worked with so many packages over the years that install things in the oddest of places -- that when I see that a package has built a 'libphp5.so' and I've got another package trying to link with -lphp5, I go looking for said 'libphp5.so' in the system... When I find it in an unexpected place (not in /lib, /usr/lib, etc.) I just assume the installer is "special" and decided to install it in its own special place so I create a sym link in the appropriate place for use with other packages. Perhaps it would make more sense to name the libraries appropriately? I.e. libphp5apxs.so, libphp5embed.so? I mean 'libphp5.so' should be *exactly* the same as 'libphp5.so' shouldn't it? libjpeg is libjpeg ... libperl is libperl.

Anyway... just some thoughts...

-L)
 [2009-07-21 14:07 UTC] lcoffin at cio dot com
Another point... the "CLI" is referred to as an "SAPI" here: http://us2.php.net/features.commandline

When I compile PHP, using --with-apxs2 and/or --enable-embed, it also builds and installs the CLI version of PHP as well, right? Doesn't that conflict with your statement "You can't build multiple SAPIs"? I'm building the Apache SAPI and I'm building the CLI SAPI... That to me indicates that it's normal to build multiple SAPIs at once. And I don't see anything obvious in the docs that would indicate otherwise.

Just saying... not being able to build apxs2 and embed at the same time is less than clear.

-L)
 [2010-09-26 22:34 UTC] jaimie at seoegghead dot com
I too agree.  The documentation re: this limitation is extremely sparse, and the CLI is definitely referred to as a SAPI.  You'd expect to be able to switch on the flag.  I forced the issue by modifying the configure flags on the port in FreeBSD, but it ignored it.

I'm used to being able to grab a port from FreeBSD ports and just installing.  Now I have to compile directly from source and specify a prefix for my special embed build.  I'm not complaining, but it should be documented somewhere.  I found out only after banging my head against the wall several times that I'd have better spent my time elsewhere (figuring out how to get it done via the sources).

Stop brain injury.  Document this :)
 [2010-11-14 00:23 UTC] jani@php.net
-Status: Bogus +Status: Closed -Assigned To: +Assigned To: jani
 [2010-11-14 00:23 UTC] jani@php.net
Sort of "fixed" in trunk, now it's possible to build all binary SAPIs (executables) the same time plus one SAPI _module_ like Apache module is.
 [2010-11-14 00:23 UTC] jani@php.net
-Package: Unknown/Other Function +Package: Compile Failure
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 16:01:31 2024 UTC