|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58827 APC fails to compile if external PCRE is installed in non-standard prefix
Submitted: 2009-08-24 16:21 UTC Modified: 2013-02-18 00:35 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5_3 CVS-2009-08-24 (dev) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-08-24 16:21 UTC]
1) External PCRE lib installed in /tmp/pcre
2) PHP built with --with-pcre-regex=/tmp/pcre
3) There must be no other pcre.h in the system (I removed my distro's pcre-devel).
With this (quite unusual, I agree) configuration APC fails to compile with the following error:

In file included from /tmp/apc/trunk/apc.c:43:
/tmp/ppp/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory

The reason is that there is no -I/tmp/pcre/include in CFLAGS.
PECL/filter already has a solution for this problem, see its config.m4.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-25 17:44 UTC] gopalv82 at yahoo dot com
I'm slightly confused as to how/where the CPPFLAGS is reset or changed at all in filter/config.m4.

The only difference I can see is that there's an extra PHP_ADD_EXTENSION_DEP?

Is this just a question of adding the PHP_ADD_EXTENSION_DEP?

Since I don't have a build box without pcre on it, I'm a little lost on how to test this out.
 [2009-09-27 00:26 UTC]
I'm able to reproduce this on OS X by referencing the pcre installation in /opt/local.  However the filter extension does not compile correctly either.  I believe this is a problem with how the php_pcre.h is abstracted, as it expects an extension to be able to include the pcre.h file without PHP providing it's location.  There seems to be two solutions: 1) add a with-pcre-dir option to APC to include the proper path, the user will have to specify this 2) fix the PHP code to handle this properly by either abstracting it so that pcre.h does not need to be included or making the include path available to extensions.  Any other thoughts on how to go about fix this?  If, like Gopal, I'm also missing something going on in the filter or you're able to compile it please send us specifics on your configuration options etc.
 [2009-09-27 20:10 UTC]
Brian, I think the best way would be to do it in PHP itself instead of doing it per extension so we don't end up with many of the same configuration arguments for different extensions.

But for BC I guess we need to add a new configuration argument.
 [2009-10-08 12:03 UTC]
 [2009-10-11 09:22 UTC] pierre dot php at gmail dot com
A cleaner solution would be to add a macro in PHP to set the PCRE flags automatically, like what we have for openssl or libxml. PCRE detection can be tricky so such macros could be used by any extension.
 [2009-10-18 16:30 UTC] lgelfan at gmail dot com
While not a solution, by soft-linking to the alternate pcre.h location (e.g., "ln -s /opt/local/include/pcre.h /usr/include/php/ext/pcre/"), I was able to get it to compile.
 [2009-10-19 09:34 UTC]
This is so unusual that you should not mess the rest of the build system to "fix" this. And if you need external pcre, you're on your own anyway ;)
 [2009-10-19 12:09 UTC]
Doesn't sound like the build system changes would be so significant to cause other problems does it?  Besides, if we offer an alternative pcre DIR option during PHP configuration then we should support it actually compiling correctly, otherwise we should do-away with the configuration option all-together.  Having something that half-works doesn't seem ideal, regardless of it's frequency.
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 23:05:52 2022 UTC