Skip to content
This repository has been archived by the owner on Aug 10, 2019. It is now read-only.

php 5.6.9 Upgrade PCRE errors #85

Closed
smelchior opened this issue May 19, 2015 · 49 comments
Closed

php 5.6.9 Upgrade PCRE errors #85

smelchior opened this issue May 19, 2015 · 49 comments

Comments

@smelchior
Copy link

After upgrading our server to the latest 5.6.9 version we get errors within swiftmailer (same issue as swiftmailer/swiftmailer#259):
preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found

the swiftmailer ticket suggest that this is somehow a pcre linking issue.
With php 5.6.8 everything is fine. The changelog for php 5.6.9 mentions a PCRE update, this is probably related?

@gplessis
Copy link
Owner

It's probably related.

Dotdeb packages rely on the bundled PCRE library and it looks like its latest update is messing with your code, especially with SwiftMailer's regex. I'm sorry, but I can't change the way PHP is linked to PCRE.

Could you please isolate the faulty code and report it to the SwiftMailer dev team to make it compatible with PCRE 8.37?

@dmaicher
Copy link

Actually the swiftmailer code works just fine using php 5.6.9 in CLI. We only have the issue using it via apache 2 mod php5. So not sure where the issue is exactly? :(

EDIT: phpinfo says

PCRE Library Version    8.36 2014-09-26 

Shouldn't it be 8.37 according to the release changelog?

@liayn
Copy link

liayn commented May 25, 2015

@gplessis
Copy link
Owner

Ok. If you need to downgrade, take a look at http://archives.dotdeb.org/

@d1gi
Copy link

d1gi commented May 30, 2015

gplessis, if I need to downgrade to 5.6.8, what string is needed in /etc/apt/sources.list ?

@gplessis
Copy link
Owner

@d1gi : take a look at http://archives.dotdeb.org/, you can get the packages you need and install them manually with dpkg -i .... Unfortunately, it's not a repo.

@gplessis
Copy link
Owner

gplessis commented Jun 2, 2015

A intermediate release is coming (see 72b99de)

@gplessis
Copy link
Owner

gplessis commented Jun 3, 2015

Packages of PHP 5.6.9 have been updated a few hours ago. Can you confirm that the problem has been fixed?

@akrabat
Copy link

akrabat commented Jun 3, 2015

Doesn't seem fixed here. However, I'm not sure if I have the update?

$ php --version
PHP 5.6.9-1~dotdeb+7.2 (cli) (built: Jun  2 2015 19:39:06) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies

but:

$ php -i | grep PCR
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.36 2014-09-26

Aren't we suppose to be seeing 8.37?

@dmaicher
Copy link

dmaicher commented Jun 3, 2015

Thx for the update! Unfortunately still the same for me as well :(

@gplessis
Copy link
Owner

gplessis commented Jun 3, 2015

Yeah, you did update. I'll investigate further to figure out why the PCRE version hasn't been upgraded.

@d1gi
Copy link

d1gi commented Jun 4, 2015

no, not fixed.

@machour
Copy link

machour commented Jun 9, 2015

bug confirmed, still not fixed

@fgerards
Copy link

http://php.net/ChangeLog-5.php#5.6.10 - new versions are out....

@machour
Copy link

machour commented Jun 12, 2015

It seems that the bug is still present after upgrading to 5.6.10-1~dotdeb+7.1
PCRE Library Version is still set to 8.36 2014-09-26 in phpinfo() ..
am I missing something ?

@darthmaim
Copy link

Confirmed, its still not fixed with 5.6.10-1~dotdeb+7.1.

@fgerards
Copy link

Well, then you compiled it wrong - the GIT-Source for PHP 5.6.10 is correct in this spot, see: https://github.com/php/php-src/blob/php-5.6.10/ext/pcre/pcrelib/config.h

@gplessis gplessis reopened this Jun 12, 2015
@gplessis
Copy link
Owner

Sorry for this. My source tree is clean (https://github.com/gplessis/dotdeb-php5/blob/master-5.6/wheezy/ext/pcre/pcrelib/config.h). I'll check my CI server.

@gplessis
Copy link
Owner

Starting from the sources from www.php.net, I'm still getting a wrong version in phpinfo() :

$ tar xf php-5.6.10.tar.xz
$ cd php-5.6.10/
$ grep '^#define VERSION ' ext/pcre/pcrelib/config.h
#define VERSION "8.37"
$ ./configure --disable-all --enable-cli
$ make
$ ./sapi/cli/php -i|grep 'PCRE Library Version'     
PCRE Library Version => 8.36 2014-09-26

I tested on several environnements (Dockerized Wheezy, stock Wheezy, OS X). Always the same result.

After some investigation, I found that the "PCRE Library Version" comes from the pcre_version() function from the bundled PCRE library and that the PHP upstream fix is incomplete : PCRE_MINOR has not been changed in pcre.h.

I'll post an update on bug #69689 to make sure that the PCRE update is complete.

gplessis added a commit that referenced this issue Jun 13, 2015
gplessis added a commit that referenced this issue Jun 13, 2015
gplessis added a commit that referenced this issue Jun 13, 2015
gplessis added a commit that referenced this issue Jun 13, 2015
@gplessis
Copy link
Owner

Guys, I just uploaded new PHP 5.6 packages (versions 5.6.10-1~dotdeb+7.2 and 5.6.10-1~dotdeb+zts+7.2). Could you please confirm that PCRE 8.37 is displayed? If so, does it fixes your original issue?

@dmaicher
Copy link

Thx for the update. Now the version looks correct:

php -v
PHP 5.6.10-1~dotdeb+7.2 (cli) (built: Jun 13 2015 20:08:39) 

php -i | grep PCRE
PCRE Library Version => 8.37 2015-04-28

Unfortunately the original problem with the swiftmailer regex using apache2 mod php stays the same :(

@darthmaim
Copy link

Confirming that the version is now reported correctly, but I am still getting the same error.

@gplessis gplessis reopened this Jun 14, 2015
@gplessis
Copy link
Owner

Ok, I suspect PCRE 8.37 - the one bundled with mod_php - to be incompatible with the system PCRE -the one used by Apache. Guys, is this issue happening only with Apache or do you use an alternative SAPI - such as FPM, CGI or FastCGI?

Could you please test the problematic portion of code with another SAPI (CLI, FPM...), see if the issue still happens, and keep me posted? Thanks.

@akrabat
Copy link

akrabat commented Jun 14, 2015

Yes. It works with fast-cgi, but not with mod_php.

@gplessis
Copy link
Owner

Guys, could you please try one of this new packages, depending on you config :

The change is that Apache modules are now built against the system PCRE. It should avoid conflict with the one included in Apache - it's now basically the same. No change for the other SAPIs (details here).

Please keep me posted.

@akrabat
Copy link

akrabat commented Jun 15, 2015

@gplessis The new amd64 deb works for me. Thanks.

@xkobal
Copy link

xkobal commented Jun 15, 2015

I have tested on Debian 7 and it's the same for me with :
libapache2-mod-php5 5.6.10-1~dotdeb+7.2 amd64

@gplessis
Copy link
Owner

@xkobal : "the same for me" << do you me that it is working now or not?

If it's still not working, could you please :

  • publish a phpinfo()
  • post here the problematic code
  • publish a page with the above code showing the exact error

Thanks

@xkobal
Copy link

xkobal commented Jun 15, 2015

Does not work (sorry for my previous message).

The code which does not work is the Swiftmailer regex, here is the error:
Jun 15 08:24:08 jfg-stage-internal-1 apache2: PHP Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given [developers@jfg-networks.net] does not comply with RFC 2822, 3.6.2.' in /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php:348#012Stack trace:#12#0 /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(263): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('developers@jfg-...')#12#1 /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(106): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array)#12#2 /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(63): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)#12#3 /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php(602): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array)#12#4 /home/web/OverblogUser-65 in /home/web/OverblogUser-654/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php on line 348

I can't provide phpinfo, because I rollback my servers, but here is the list of installed packages:
libapache2-mod-php5 5.6.10-1dotdeb+7.2
php-pear 5.6.10-1
dotdeb+7.2
php5 5.6.10-1dotdeb+7.2
php5-apcu 1:4.0.7-1
dotdeb.2
php5-cli 5.6.10-1dotdeb+7.2
php5-common 5.6.10-1
dotdeb+7.2
php5-curl 5.6.10-1dotdeb+7.2
php5-dev 5.6.10-1
dotdeb+7.2
php5-gd 5.6.10-1dotdeb+7.2
php5-imagick 1:3.1.2-1
dotdeb.2
php5-intl 5.6.10-1dotdeb+7.2
php5-mcrypt 5.6.10-1
dotdeb+7.2
php5-memcache 1:3.0.8-1dotdeb.2
php5-mysql 5.6.10-1
dotdeb+7.2
php5-pgsql 5.6.10-1dotdeb+7.2
php5-readline 5.6.10-1
dotdeb+7.2
php5-sqlite 5.6.10-1~dotdeb+7.2

@gplessis
Copy link
Owner

@xkobal : you're using PHP 5.5, that hasn't been fixed yet. I'll published 5.5.26 soon.

@gplessis
Copy link
Owner

@akrabat thanks for your feedback.

@xkobal
Copy link

xkobal commented Jun 15, 2015

No sorry, that was my rollback server dpkg, I use 5.6.10-1~dotdeb+7.2

@gplessis
Copy link
Owner

@xkobal did you use the one from my above comment, install it with dpkg -i and restart your Apache server completely? Please give it one more try, see if the issue is fixed or not and please give me the value of "Build Date" shown at the beginning of your Apache's phpinfo(), before downgrading.

Thanks.

@xkobal
Copy link

xkobal commented Jun 15, 2015

OK, works for me ;-) I thought that the libapache2-mod-php5 was published.

@gplessis
Copy link
Owner

@xkobal no, I wanted to make sure that the issue was fixed before releasing new packages.

A fixed PHP 5.6 is currently building. PHP 5.5 and 5.4 should follow.

@mybigman
Copy link

@gplessis thanks...

Ive been pulling my hair out all day... glad your working on the 5.5 version.

@alexey-m-ukolov
Copy link

Latest build worked for me, thanks.

@gplessis
Copy link
Owner

5.6.10-1~dotdeb+7.3 and 5.6.10-1~dotdeb+zts+7.3have been published.

@darthmaim
Copy link

Works great, thanks for that! 👍

@dmaicher
Copy link

Also fixed here. Thx! :)

@akrabat
Copy link

akrabat commented Jun 15, 2015

Fixed here too. Thank you @gplessis.

@MichaelUbuntu
Copy link

on php 5.5 exist exakt the same error !

php -v
PHP 5.5.25-1~dotdeb+7.1 (cli) (built: May 15 2015 16:39:22)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans

php -i | grep PCRE
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.36 2014-09-26

i have found the error under:

PHP Warning: preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 728 in /var/www-s/joom_sib/libraries/vendor/phpmailer/phpmailer/class.phpmailer.php on line 916, referer: ........

@machour
Copy link

machour commented Jun 16, 2015

@MichaelUbuntu built: May 15 2015 16:39:22
You should probably apt-get update. If the date doesn't change, it means that PHP 5.5 packages are not ready yet and that you should probably reopen this as a reminder for @gplessis ;)

@MichaelUbuntu
Copy link

yes i have already done the following:
apt-get update && apt-get upgrade

but nothing changed in php 5.5

@gplessis
Copy link
Owner

fixed PHP 5.5 and PHP 5.4 packages will be published today. Thanks for your patience.

@MaZderMind
Copy link

just a nuisance:

apcu does not load on cli anymore, becuause of undefined symbol: pcre_exec:

php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/apcu.so' - /usr/lib/php5/20121212/apcu.so: undefined symbol: pcre_exec in Unknown on line 0

But as apcu does nothing useful on cli anyway, it's easy to disable it:

php5dismod -s cli apcu

Works in Apache nicely, though.

@gplessis
Copy link
Owner

@MaZderMind ok, switch to #81 for this issue

@MichaelUbuntu
Copy link

thanks problem is solved

@gplessis
Copy link
Owner

FYI, I had to use the system PCRE for all the SAPIs to avoid conflicts with PECL extensions. Don't bother if you see PCRE reported as "8.30 2012-02-04" on PHP 5.5. I'll propagate the changes on all PHP versions soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests