You are not logged in.

#1 2024-07-15 18:54:11

SomeoneNoone
Member
Registered: 2024-07-15
Posts: 2

PHP HTTP extension is incompatible, and I can't install PECL/PEAR

I'm trying to get a working PHP installation, but none of the supported php versions seem to have a working http module, which is a dependency of my project.

So far I've tried installing php-http & php-raphf, as well as some attempts to get PECL/PEAR installed which didn't pan out.

When running `php -v` with php-http and raphf instaleld, I get:

> php -v
PHP Warning:  PHP Startup: Unable to load dynamic library 'http.so' (tried: /usr/lib/php/modules/http.so (/usr/lib/php/modules/http.so: undefined symbol: php_resource_factory_handle_dtor), /usr/lib/php/modules/http.so.so (/usr/lib/php/modules/http.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.3.9 (cli) (built: Jul  2 2024 15:37:13) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies

So it is finding the http module, but it's incompatible.

I then tried to get pecl/pear installed so I could install the http module through that instead, but for some reason the php-pear package (as mentioned in the wiki) doesn't actually install /usr/bin/pecl (and when listing the installed files for that package, there are no useful executables installed by it, including even pear itself). I attempted to manually install pear via the instructions on pears website, but its phar installer seems to fail specifically on the part where PEAR would be installed, giving:

parsePackageName(): array $param must contain a valid package name in "phar://redacted/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.15.tar"
Invalid tag order in <dependencies>, found <_content> expected one of "group"
Parsing of package.xml from file "/tmp/pear/install/pearr3lOJH/package.xml" failed

So now I'm stuck, I'm not sure how to get a working php installation which includes php-http. I also tried with older versions of php from the aur, but they're all missing the http module as well as pecl/pear. What am I missing?

Any help is appreciated.

Offline

#2 2024-07-15 19:12:49

cryptearth
Member
Registered: 2024-02-03
Posts: 613

Re: PHP HTTP extension is incompatible, and I can't install PECL/PEAR

all I found was this: https://pecl.php.net/package/pecl_http - so whatever that extension is it's NOT a base php extension - so calling it php-http sounds wrong
the doc links here: https://mdref.m6w6.name/http
I'm not sure what that project of yours is that depends on this - but to me this is nothing I would want to install on my server

Offline

#3 2024-07-15 19:19:36

SomeoneNoone
Member
Registered: 2024-07-15
Posts: 2

Re: PHP HTTP extension is incompatible, and I can't install PECL/PEAR

cryptearth wrote:

all I found was this: https://pecl.php.net/package/pecl_http - so whatever that extension is it's NOT a base php extension - so calling it php-http sounds wrong
the doc links here: https://mdref.m6w6.name/http
I'm not sure what that project of yours is that depends on this - but to me this is nothing I would want to install on my server

It struck me as somewhat odd to be honest. The project in question is one I recently inherited and have yet to have a proper handover for, but it's based on Laravel which doesn't usually require this module.. Now, I'm thinking I can probably remove it as a dependency but I don't want to risk it if I don't have to.

I guess my bigger question is: Why the hell isn't pecl/pear working?

Offline

#4 2024-07-15 20:33:45

cryptearth
Member
Registered: 2024-02-03
Posts: 613

Re: PHP HTTP extension is incompatible, and I can't install PECL/PEAR

seems an upstream issue - follow https://pear.php.net/manual/en/installation.getting.php fails at the manual install
I tried to build it from upstream git repo - but it's a recursive crap: you need a working PEAR install to build it from source - the github build uses a debian base
my advice: whatever your project is using this "lib" for - replace that stuff with some better available lib - or kill it anyway as using http from within php is something I would only use when writing a CLI - nothin I would run on my webserver - this all sounds very weird

Offline

#5 2024-07-19 04:54:30

amish
Member
Registered: 2014-05-10
Posts: 473

Re: PHP HTTP extension is incompatible, and I can't install PECL/PEAR

This is most likely related to recent bug between php and libxml2

Explained here: (similar looking problem)
https://github.com/php/php-src/issues/14834

Fix should be in PHP 8.3.10

Offline

#6 2024-07-19 08:37:21

cryptearth
Member
Registered: 2024-02-03
Posts: 613

Re: PHP HTTP extension is incompatible, and I can't install PECL/PEAR

somewhat reminds to wget when something changed but the update took time cause one of the most used tools is maintained by a single person
code reuse is cool - but with a tree of a dozen it can bite many very severely
thanks for the info

Offline

Board footer

Powered by FluxBB