Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 612054 - dev-php/pecl-http-2.6.0 - http.so: undefined symbol: php_resource_factory_handle_ctor
Summary: dev-php/pecl-http-2.6.0 - http.so: undefined symbol: php_resource_factory_ha...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-08 14:43 UTC by Christian Affolter
Modified: 2017-03-19 17:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Affolter 2017-03-08 14:43:04 UTC
Installing =dev-php/pecl-http-2.6.0 within a PHP 5.6 environment and using one of its provided methods, results in the following error message:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5.6/lib/extensions/no-debug-non-zts-20131226/http.so' - /usr/lib64/php5.6/lib/extensions/no-debug-non-zts-20131226/http.so: undefined symbol: php_resource_factory_handle_ctor in Unknown on line 0


The problem seems to be the wrong start-up order of the pecl-http extension and its dependencies (propro and raphf).

Steps to reproduce:

# Install dev-php/pecl-http
emerge -va =dev-php/pecl-http-2.6.0

# Call one of its methods
php -r 'var_dump(new http\Client);'

# The following error message appears
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5.6/lib/extensions/no-debug-non-zts-20131226/http.so' - /usr/lib64/php5.6/lib/extensions/no-debug-non-zts-20131226/http.so: undefined symbol: php_resource_factory_handle_ctor in Unknown on line 0
PHP Fatal error:  Class 'http\Client' not found in Command line code on line 1


Workaround:

# Make sure the pecl-http extension will be loaded after the propro and raphf extensions
cd /etc/php/cli-php5.6/ext-active
mv http.ini zzz-http.ini

# The same workaround can be applied if using PHP with /etc/php/apache2-php5.6/ext-active

# Test it again
php -r 'var_dump(new http\Client);'

object(http\Client)#1 (4) {
  ["observers":"http\Client":private]=>
  object(SplObjectStorage)#2 (1) {
    ["storage":"SplObjectStorage":private]=>
    array(0) {
    }
  }
  ["options":protected]=>
  NULL
  ["history":protected]=>
  NULL
  ["recordHistory"]=>
  bool(false)
}



See also:
* https://mdref.m6w6.name/http#PHP.extensions:
* http://stackoverflow.com/questions/21077976/pecl-http-failed-to-load/23356662#23356662
Comment 1 Michael Orlitzky gentoo-dev 2017-03-19 17:34:18 UTC
I hacked together a fix for this using your suggestion. After pecl-http is installed, I rename the symlinks to "zzhttp.ini". It would be better to have a real fix in the eclass, so I've made a note over on bug 586446, but the hack should work for now. Thanks!