ID:               48989
 User updated by:  lcoffin at cio dot com
 Reported By:      lcoffin at cio dot com
 Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Ubuntu 8.04
 PHP Version:      5.3.0
 New Comment:

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


Previous Comments:
------------------------------------------------------------------------

[2009-07-21 13:46:30] 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 12:59:42] j...@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-20 16:13:16] 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.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48989&edit=1

Reply via email to