awslabs / aws-crt-php

Apache License 2.0
322 stars 13 forks source link

PHP 5.x compatibility - undefined symbol: zend_error_noreturn #95

Closed remicollet closed 1 year ago

remicollet commented 1 year ago

Since 1.2.0, package.xml states 5.5 is supported

PHP Warning:  PHP Startup: Unable to load dynamic library '/builddir/build/BUILDROOT/php-pecl-awscrt-1.2.0-1.el7.remi.5.5.x86_64//usr/lib64/php/modules/awscrt.so' - /builddir/build/BUILDROOT/php-pecl-awscrt-1.2.0-1.el7.remi.5.5.x86_64//usr/lib64/php/modules/awscrt.so: undefined symbol: zend_error_noreturn in Unknown on line 0

zend_error_noreturn was introduced, as public API in PHP 7.0

TingDaoK commented 1 year ago

We do run tests for php 5.6, here

But, yeah, seems like we have issue for php5.5

remicollet commented 1 year ago

We do run tests for php 5.6, here

PHP 5.6 is also affected See explanation on pr #96

TingDaoK commented 1 year ago

I mean we have test for php5.6, that builds and runs the code. But, I see your fix should be needed for php 5.x, just kind wander why it's not caught by our CI for php5.6.

remicollet commented 1 year ago

I mean we have test for php5.6, that builds and runs the code. But, I see your fix should be needed for php 5.x, just kind wander why it's not caught by our CI for php5.6.

Real builds (packages) for real distributions use lot of security build options.

TingDaoK commented 1 year ago
  • /usr/bin/php --version PHP 5.5.38 (cli) (built: Feb 12 2023 11:38:56) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

I printed php --version from our CI that used shivammathur/setup-php to setup the exact version of php. I still cannot reproduce the issue with CI.

I did reproduced it from my local linux machine that used php55 from here, with that I also printed the version of php, which is:

php55 --version
PHP 5.5.38 (cli) (built: Jun 23 2022 08:01:11) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

could that be related to with Zend OPcache v7.0.6-dev?

remicollet commented 1 year ago

No this is related to PHP build options used in Linux distribution for security and performance.

See: https://github.com/php/php-src/blob/PHP-7.0/Zend/zend.h#L86 this is in public API (ZEND_API) See: https://github.com/php/php-src/blob/PHP-5.5/Zend/zend.h#L294 this is not public

TingDaoK commented 1 year ago

Okay, I see. I tried to install php using ondrej/php, which is used by setup-php action here.

Now, I cannot reproduce that error.

Yeah, I think it's very likely that php build doesn't-have the default "visibility = hidden" option. :)

I'll create an issue to shivammathur/setup-php and see if they can fix it in order to catch this kind of issue from our CI.

TingDaoK commented 1 year ago

the new 1.2.1 version should solve the issue. https://pecl.php.net/package/awscrt/1.2.1