# PECL install no longer works out of the box

- Thread: https://externals.io/message/85807
- Original archive: https://news-web.php.net/php.internals/85807
- Started by Hannes Magnusson on 2015-04-14T17:17:34+00:00
- Messages: 16
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #85807 — Hannes Magnusson — 2015-04-14T17:17:34+00:00

URL: https://externals.io/message/85807#85807

Hi

Can someone with access to the new pecl box fix the package downloading?
It is totally broken apparently.

On vanilla FreeBSD 10:

$ pecl install memcached
No releases available for package "pecl.php.net/memcached"
install failed
$ pecl search memcached
Connection to `ssl://pecl.php.net:443' failed: Unable to find the
socket transport "ssl" - did you forget to enable it when you
configured PHP?
$ php -m | grep -i ssl
openssl
$ php -i | grep -i "PHP Streams"
Registered PHP Streams => php, file, glob, data, http, ftp, https, ftps
$ php -v
PHP 5.6.7 (cli) (built: Apr  8 2015 15:18:53)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies



The installer doesn't feel very good about the recent unannounced
decision that pecl is now only available on https (which isn't
entirely true -- it answers to http, at which point if there was a
MITM he wouldn't forward you to https and just keep you on http..
so..... no win).


I've also seen people complaining over the .tar files now not actually
being .tar files -- they apparently are gzipped, which clearly doesn't
work on all systems -- which is why we provide .tar.

-Hannes

---

## #85834 — Hannes Magnusson — 2015-04-16T17:43:09+00:00

URL: https://externals.io/message/85807#85834

>
>
> 
> > […]
>
>
>
> ok, after discussing with Pierre I gunzipped the release tarballs so now
> they are there, Pierre will update the release upload/delete code so that we
> also store/delete the .tar files so they can be also served via sendfile.

$ sudo pecl install memcached
Could not download from "http://pecl.php.net/get/memcached-2.2.0.tar",
cannot download "pecl/memcached" (File
http://pecl.php.net:80/get/memcached-2.2.0.tar not valid (received:
HTTP/1.0 404 Not Found
))
Error: cannot download "pecl/memcached"
Download failed
install failed


Still doesn't work... Maybe peclweb hasn't updated yet?


> about the ssl related changes: we should look into the cause and there is a
> chance that we will also need to fix/update the pear installer.


The fix would need to be BC though -- prioritize https, and issue
warning on failure. You cannot just remove http downloads without
announcing it.

You have to be able to install pecl extensions with minimal PHP install:
./configure --disable-all --enable-cli && pecl install foobar

heck, currently even standard PHP-out-of-the-box ./configure is good
enough to install pecl extension because it doesn't even enable zlib
and openssl by default.

So until the zlib and openssl extension become requirements we cannot
screw people over like that.

-Hannes

---

## #85835 — Hannes Magnusson — 2015-04-16T17:46:53+00:00

URL: https://externals.io/message/85807#85835 · In reply to: #85834

On Thu, Apr 16, 2015 at 10:43 AM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> 
> > […]
>
> $ sudo pecl install memcached
> Could not download from "http://pecl.php.net/get/memcached-2.2.0.tar",
> cannot download "pecl/memcached" (File
> http://pecl.php.net:80/get/memcached-2.2.0.tar not valid (received:
> HTTP/1.0 404 Not Found
> ))
> Error: cannot download "pecl/memcached"
> Download failed
> install failed
>
>
> Still doesn't work... Maybe peclweb hasn't updated yet?
>
>
> > […]
>
>
> The fix would need to be BC though -- prioritize https, and issue
> warning on failure. You cannot just remove http downloads without
> announcing it.
>
> You have to be able to install pecl extensions with minimal PHP install:
> ./configure --disable-all --enable-cli && pecl install foobar
>
> heck, currently even standard PHP-out-of-the-box ./configure is good
> enough to install pecl extension because it doesn't even enable zlib
> and openssl by default.

Whopsy, typo alert -- that is supposed to say "currently even standard
PHP is _NOT_ good enough" :)


Before the recent changes during the server move, everything worked just fine.

Thanks for looking at this Martin & Ferenc!

-Hannes

---

## #85836 — Pierre Joye — 2015-04-16T17:48:27+00:00

URL: https://externals.io/message/85807#85836 · In reply to: #85835

On Fri, Apr 17, 2015 at 12:46 AM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> On Thu, Apr 16, 2015 at 10:43 AM, Hannes Magnusson
> <hannes.magnusson@gmail.com> wrote:
> > […]
>
> Whopsy, typo alert -- that is supposed to say "currently even standard
> PHP is _NOT_ good enough" :)
>
>
> Before the recent changes during the server move, everything worked just fine.
>
> Thanks for looking at this Martin & Ferenc!

You are welcome! My pleasure to do the work and get so many feedback
and tests from you during the migration and now. Always awesome.

-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #85837 — Pierre Joye — 2015-04-16T17:52:08+00:00

URL: https://externals.io/message/85807#85837 · In reply to: #85834

On Fri, Apr 17, 2015 at 12:43 AM, Hannes Magnusson
<hannes.magnusson@gmail.com> wrote:
> 
> > […]
>
> $ sudo pecl install memcached
> Could not download from "http://pecl.php.net/get/memcached-2.2.0.tar",
> cannot download "pecl/memcached" (File
> http://pecl.php.net:80/get/memcached-2.2.0.tar not valid (received:
> HTTP/1.0 404 Not Found
> ))
> Error: cannot download "pecl/memcached"
> Download failed
> install failed
>
>
> Still doesn't work... Maybe peclweb hasn't updated yet?
>
>
> > […]
>
>
> The fix would need to be BC though -- prioritize https, and issue
> warning on failure. You cannot just remove http downloads without
> announcing it.
>
> You have to be able to install pecl extensions with minimal PHP install:
> ./configure --disable-all --enable-cli && pecl install foobar
>
> heck, currently even standard PHP-out-of-the-box ./configure is good
> enough to install pecl extension because it doesn't even enable zlib
> and openssl by default.
>
> So until the zlib and openssl extension become requirements we cannot
> screw people over like that.

Actually the SSL update should show a notice that the channel has been
updated as well as making openssl and zlib requirements for pecl
command line tools. Zlib does not have to be a requirement anymore as
the tar are available. When called from the installer, the /get/ call
is used, so yes, wait until peclweb is updated.The 404 commits for
.tar have been reverted so everything should be fine.

We may however allow http://pecl.php.net/channel.xml, and only that,
so even install without openssl will get it. I will look into that in
the next days, test with default pear install and enable ssl again.
https is not an option to distribute software, sorry.

I also reported a bug to pear about updating the default channel, and
gzip, while it is not a requirement anymore but at least ppl will get
smaller packages then.

Cheers,
-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #85838 — Ferenc Kovacs — 2015-04-16T18:02:50+00:00

URL: https://externals.io/message/85807#85838 · In reply to: #85834

On Thu, Apr 16, 2015 at 7:43 PM, Hannes Magnusson <
hannes.magnusson@gmail.com> wrote:

> 
> > […]
> wrote:
> > […]
> wrote:
> > […]
> migration,
> > […]
> /var/log/apache2/pecl.php.net-access.log|wc
> > […]
> /var/log/apache2/pecl.php.net-access.log|wc -l
> > […]
> that we
> > […]
>
> $ sudo pecl install memcached
> Could not download from "http://pecl.php.net/get/memcached-2.2.0.tar",
> cannot download "pecl/memcached" (File
> http://pecl.php.net:80/get/memcached-2.2.0.tar not valid (received:
> HTTP/1.0 404 Not Found
> ))
> Error: cannot download "pecl/memcached"
> Download failed
> install failed
>

it seems that the two commits (reverts) which should make that error go
away still not make to the peclweb machine yet.
I will wait an hour or so, if still not there I will check out the rsync
box (as I verified that the update-peclweb is executed properly).

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #85840 — Ferenc Kovacs — 2015-04-16T18:06:17+00:00

URL: https://externals.io/message/85807#85840 · In reply to: #85838

>
>
> On Thu, Apr 16, 2015 at 7:43 PM, Hannes Magnusson <
> hannes.magnusson@gmail.com> wrote:
>
> > […]
>
> it seems that the two commits (reverts) which should make that error go
> away still not make to the peclweb machine yet.
> I will wait an hour or so, if still not there I will check out the rsync
> box (as I verified that the update-peclweb is executed properly).
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu
>


oops, I made a mistake, one of the two reverts was against the wrong hash.
just fixed it now.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #85841 — Hannes Magnusson — 2015-04-16T18:18:45+00:00

URL: https://externals.io/message/85807#85841 · In reply to: #85840

>
>
> 
> > […]
>
>
>
> oops, I made a mistake, one of the two reverts was against the wrong hash.
> just fixed it now.



Getting closer :)

$ sudo pecl install memcached
downloading memcached-2.2.0.tar ...
Starting to download memcached-2.2.0.tar (70,449 bytes)
.....done: 70,449 bytes
could not extract the package.xml file from
"/tmp/pear/download/memcached-2.2.0.tar"
Download of "pecl/memcached" succeeded, but it is not a valid package archive
Error: cannot download "pecl/memcached"
Download failed
install failed
$ file /tmp/pear/download/memcached-2.2.0.tar
/tmp/pear/download/memcached-2.2.0.tar: gzip compressed data, from
Unix, max compression


It looks like it is actually gzipped?

-Hannes

---

## #85842 — Ferenc Kovacs — 2015-04-16T18:26:44+00:00

URL: https://externals.io/message/85807#85842 · In reply to: #85841

On Thu, Apr 16, 2015 at 8:18 PM, Hannes Magnusson <
hannes.magnusson@gmail.com> wrote:

> 
> > […]
> wrote:
> > […]
> the
> > […]
> if
> > […]
> And
> > […]
> one
> > […]
> how
> > […]
> so I
> > […]
> hash.
> > […]
>
>
>
> Getting closer :)
>
> $ sudo pecl install memcached
> downloading memcached-2.2.0.tar ...
> Starting to download memcached-2.2.0.tar (70,449 bytes)
> .....done: 70,449 bytes
> could not extract the package.xml file from
> "/tmp/pear/download/memcached-2.2.0.tar"
> Download of "pecl/memcached" succeeded, but it is not a valid package
> archive
> Error: cannot download "pecl/memcached"
> Download failed
> install failed
> $ file /tmp/pear/download/memcached-2.2.0.tar
> /tmp/pear/download/memcached-2.2.0.tar: gzip compressed data, from
> Unix, max compression
>
>
> It looks like it is actually gzipped?
>
> -Hannes
>

hm, weird, created it via gunzip -c ing the tgz, so it should be a tar file:
root@pecl:~# file /var/lib/pear/memcached-2.2.0.tar
/var/lib/pear/memcached-2.2.0.tar: POSIX tar archive (GNU)


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #85843 — Pierre Joye — 2015-04-16T18:41:02+00:00

URL: https://externals.io/message/85807#85843 · In reply to: #85842

it is not weird as we still send the tgz not the tar.

try this: https://gist.github.com/pierrejoye/c33338677f89159f696d

I cannot test and crafted it a la volee, but it should do it:

$file is used to query the file from the database, which contains only
filenames with tgz (as we created the .tar manually now)
$basename is what is used by X-SendFile, this patch fixes it and
create <release>.tar instead of <release>.tgz




>
>
> On Thu, Apr 16, 2015 at 8:18 PM, Hannes Magnusson
> <hannes.magnusson@gmail.com> wrote:
> > […]
>
>
> hm, weird, created it via gunzip -c ing the tgz, so it should be a tar file:
> root@pecl:~# file /var/lib/pear/memcached-2.2.0.tar
> /var/lib/pear/memcached-2.2.0.tar: POSIX tar archive (GNU)
>
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu



-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #85848 — Pierre Joye — 2015-04-17T01:30:55+00:00

URL: https://externals.io/message/85807#85848 · In reply to: #85843

> it is not weird as we still send the tgz not the tar.
>
> try this: https://gist.github.com/pierrejoye/c33338677f89159f696d
>
> I cannot test and crafted it a la volee, but it should do it:
>
> $file is used to query the file from the database, which contains only
> filenames with tgz (as we created the .tar manually now)
> $basename is what is used by X-SendFile, this patch fixes it and
> create <release>.tar instead of <release>.tgz

tested and improved patch applied.

Adding the uncompressed archive saving on release now.

Cheers,

---

## #85849 — Pierre Joye — 2015-04-17T02:01:14+00:00

URL: https://externals.io/message/85807#85849 · In reply to: #85848

> 
> > […]
>
> tested and improved patch applied.
>
> Adding the uncompressed archive saving on release now.

Done.



-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #85851 — Pierre Joye — 2015-04-17T09:20:03+00:00

URL: https://externals.io/message/85807#85851 · In reply to: #85849

for the record,

20<Pierre>30 done, all
20<Pierre>30 let me know if it works
18<Tyrael> seems to be working fine, thanks


@Hannes: Please confirm.


> 
> > […]
>
> Done.
>
>
>
> --
> Pierre
>
> @pierrejoye | http://www.libgd.org



-- 
Pierre

@pierrejoye | http://www.libgd.org

---

## #85852 — Ferenc Kovacs — 2015-04-17T11:42:52+00:00

URL: https://externals.io/message/85807#85852 · In reply to: #85851

Hannes, could you please confirm that you can pecl install memcached?



> for the record,
>
>  20 < Pierre >   30 done, all
>  20 < Pierre >   30 let me know if it works
>  18 < Tyrael >   seems to be working fine, thanks
>
>
> @Hannes: Please confirm.
>
> 
> > […]
> wrote:
> > […]
> wrote:
> > […]
>
>
>
> --
> Pierre
>
> @pierrejoye | http://www.libgd.org
>



-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

---

## #85853 — Hannes Magnusson — 2015-04-17T14:48:23+00:00

URL: https://externals.io/message/85807#85853 · In reply to: #85852

$ sudo pecl install memcached
downloading memcached-2.2.0.tar ...
Starting to download memcached-2.2.0.tar (410,624 bytes)
.....done: 410,624 bytes
15 source files, building
running: phpize

\o/ - Thanks

-Hannes




> Hannes, could you please confirm that you can pecl install memcached?
>
> 
> > […]
>
>
>
>
> --
> Ferenc Kovács
> @Tyr43l - http://tyrael.hu

---

## #85854 — Ferenc Kovacs — 2015-04-17T14:56:39+00:00

URL: https://externals.io/message/85807#85854 · In reply to: #85853

On Fri, Apr 17, 2015 at 4:48 PM, Hannes Magnusson <
hannes.magnusson@gmail.com> wrote:

> $ sudo pecl install memcached
> downloading memcached-2.2.0.tar ...
> Starting to download memcached-2.2.0.tar (410,624 bytes)
> .....done: 410,624 bytes
> 15 source files, building
> running: phpize
>
> \o/ - Thanks
>
> -Hannes
>
>
it seems the fix broke the get latest urls like
https://pecl.php.net/get/memcached
I've just pushed a commit which should fix it(hopefully).
-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu
