Edit report at http://bugs.php.net/bug.php?id=48989&edit=1
ID: 48989 Updated by: j...@php.net Reported by: lcoffin at cio dot com Summary: --with-apxs2 and --enable-embed incompatible -Status: Bogus +Status: Closed Type: Bug Package: Unknown/Other Function Operating System: Ubuntu 8.04 PHP Version: 5.3.0 -Assigned To: +Assigned To: jani Block user comment: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2010-09-26 22:34:59] 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 :) ------------------------------------------------------------------------ [2009-07-21 14:07:44] 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) ------------------------------------------------------------------------ [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/bug.php?id=48989&edit=1