Skip to content

pecl update-channels failed to update phpdocs channel #151

Open
@zhangyoufu

Description

@zhangyoufu
# pecl update-channels
Updating channel "doc.php.net"
Error: Unable to create XML parser
Invalid channel.xml file
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

The root cause seems to be pecl not parsing HTTP chunked encoding response properly.

GET https://doc.php.net/channels.xml returns the following HTTP response:

HTTP/1.1 200 OK
Server: myracloud
Date: Thu, 09 Jan 2025 13:03:45 GMT
Content-Type: application/xml
Transfer-Encoding: chunked
Connection: close
Last-Modified: Wed, 07 Feb 2024 15:54:33 GMT
ETag: "276-610ccb602ffaf-gzip"
Accept-Ranges: bytes

276
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
 <name>doc.php.net</name>
 <summary>PHP Documentation team</summary>
 <suggestedalias>phpdocs</suggestedalias>
 <servers>
  <primary>
   <rest>
    <baseurl type="REST1.0">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.1">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.3">http://doc.php.net/rest/</baseurl>
   </rest>
  </primary>
 </servers>
</channel>

0

If I modify the response to fixed-length body, pecl works properly.

HTTP/1.1 200 OK
Server: myracloud
Date: Thu, 09 Jan 2025 13:03:45 GMT
Content-Type: application/xml
Content-Length: 630
Connection: close
Last-Modified: Wed, 07 Feb 2024 15:54:33 GMT
ETag: "276-610ccb602ffaf-gzip"
Accept-Ranges: bytes

<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd">
 <name>doc.php.net</name>
 <summary>PHP Documentation team</summary>
 <suggestedalias>phpdocs</suggestedalias>
 <servers>
  <primary>
   <rest>
    <baseurl type="REST1.0">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.1">http://doc.php.net/rest/</baseurl>
    <baseurl type="REST1.3">http://doc.php.net/rest/</baseurl>
   </rest>
  </primary>
 </servers>
</channel>
# pecl update-channels
Updating channel "doc.php.net"
Update of Channel "doc.php.net" succeeded
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

# pecl version
PEAR Version: 1.10.15
PHP Version: 8.3.15
Zend Engine Version: 4.3.15
Running on: Linux 362aa5001767 6.1.0-21-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions