PHPackages                             fthvgb1/gophpfetch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. fthvgb1/gophpfetch

ActiveLibrary[HTTP &amp; Networking](/categories/http)

fthvgb1/gophpfetch
==================

A php http request extension on concurrence writing in golang, use FFI to call

v1.0.2(7mo ago)07MITPHPPHP &gt;=8.1CI passing

Since Sep 24Pushed 7mo agoCompare

[ Source](https://github.com/fthvgb1/gophpfetch)[ Packagist](https://packagist.org/packages/fthvgb1/gophpfetch)[ Docs](https://github.com/fthvgb1/gophpfetch)[ RSS](/packages/fthvgb1-gophpfetch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (4)Used By (0)

### a php http request extension on concurrence writing in golang

[](#a-php-http-request-extension-on-concurrence-writing-in-golang)

use FFI to call golang http requests with concurrence.

#### install

[](#install)

- add follow contents to project's composer.json and run `composer install && composer run-script downloadExtension`.

```
{
  "require": {
    "fthvgb1/gophpfetch": "*"
  },
  "scripts": {
    "downloadExtension": [
      "@putenv COMPOSER=vendor/fthvgb1/gophpfetch/composer.json",
      "@composer downloadExtension"
    ]
  }
}
```

to avoid including the unnecessary others platform's extension files, you need to download extension file manually in [release](https://github.com/fthvgb1/gophpfetch/releases).

- enable ffi extension add follow config to php.ini or ffi.ini to using in php-fpm

```
extension=ffi.so
ffi.enable=true

```

#### example

[](#example)

```
$results = Fetch::fetch([
     [
        'url' => 'url',
        'method' => 'get',//default
        'id' => 'get request',
        'query' => ['query param' => 'values']
    ],
    [
        'url' => 'url',
        'id' => 'post request',
        'body' => ['post body param' => 'values'],
        'header' => [
            'Content-Type' => PostType::FormUrlencoded, //default post type
        ]
    ],
    [
        'url' => 'download url',
        'method' => 'get',
        'query' => ['query param' => 'value'],
        'id' => 'dowload file',
        'saveFile' => [
            'path' => 'save path',
            'mode' => '0644', //default
            'dirMode '=> '0755' //default
        ]
    ],
    [
        'url' => 'upload url',
        'method' => 'post',
        'id' => 'upload file',
        'header' => ['Content-Type' => PostType::FormData],
        'body' => [
            '__uploadFiles' => [
                'local file' => 'field'
            ]
        ]
    ]
]);
```

#### performance comparison

[](#performance-comparison)

upload 5 files and download 5 files in a request on concurrence

results:

    gophpfetch multiple curl swoole curl     xdebug [![](performtestandcomparison/pics/xdebug-gophpfetch.webp)](performtestandcomparison/pics/xdebug-gophpfetch.webp)   [![](performtestandcomparison/pics/xdebug-multiplecurl.webp)](performtestandcomparison/pics/xdebug-multiplecurl.webp)  [![](performtestandcomparison/pics/xdebug-swoolecurl.webp)](performtestandcomparison/pics/xdebug-swoolecurl.webp)   xhprof [![](performtestandcomparison/pics/xhprof-overview.webp)](performtestandcomparison/pics/xhprof-overview.webp)   [![](performtestandcomparison/pics/xhprof-gophpfetch.webp)](performtestandcomparison/pics/xhprof-gophpfetch.webp) [![](performtestandcomparison/pics/xhprof-multiplecurl.webp)](performtestandcomparison/pics/xhprof-multiplecurl.webp) [![](performtestandcomparison/pics/xhprof-swoolecurl.webp)](performtestandcomparison/pics/xhprof-swoolecurl.webp)  test method and scripts [see here](performtestandcomparison/readme.md)

#### reference

[](#reference)

[dwdcth/php\_golang\_ffi](https://github.com/dwdcth/php_golang_ffi)

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance68

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

3

Last Release

216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb99f5f9fc12fb5d28a96c78baaa1c0bedd02e36f94d8e7d904cf69496268856?d=identicon)[fthvgb1](/maintainers/fthvgb1)

---

Top Contributors

[![fthvgb1](https://avatars.githubusercontent.com/u/13779256?v=4)](https://github.com/fthvgb1 "fthvgb1 (47 commits)")

---

Tags

httprequestffigolang

### Embed Badge

![Health badge](/badges/fthvgb1-gophpfetch/health.svg)

```
[![Health](https://phpackages.com/badges/fthvgb1-gophpfetch/health.svg)](https://phpackages.com/packages/fthvgb1-gophpfetch)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.0B3.1k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M272](/packages/fig-http-message-util)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48619.2M540](/packages/nette-http)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M918](/packages/psr-http-server-handler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
