php-http/message-factory
Legacy PSR-7 HTTP message factory for PHP. Supports creating PSR-7 compliant HTTP messages (Request, Response, Stream, etc.) with ease. Maintains backward compatibility for existing codebases while encouraging migration to PSR-17 factories (now standard in major clients like Guzzle, Symfony HTTP Cli...
This package is archived and obsolete, superseded by PSR-17. You should only install it (composer require php-http/message-factory) if you're maintaining legacy code that depends on PHP-HTTP's pre-PSR-17 factory interfaces (e.g., older versions of Guzzle adapters, Symfony HttpClient < 5, or custom code using Http\Message\Factory\RequestFactory). First, check if your HTTP client library already provides PSR-17 factories — most modern libraries (Guzzle, Symfony HttpClient, HTTPlug, etc.) do. If you must use this package, start by reading its README and the official docs at http://docs.php-http.org — but prioritize migrating to psr/http-factory implementations like nyholm/psr7 or guzzlehttp/psr7 with their built-in PSR-17 factories.
In legacy codebases, developers typically used this package to:
Http\Message\Factory\RequestFactory, Http\Message\Factory\ResponseFactory) into services needing to construct PSR-7 messages without coupling to a specific implementation.php-http/guzzle6-adapter or php-http/curl-client, which internally depend on this package to provide PSR-7 message creation logic compatible with older HTTPlug versions.Http\Message\FactoryInterface.Today, the recommended migration pattern is:
// Legacy (with message-factory)
$request = $requestFactory->createRequest('GET', 'https://example.com');
// Modern (with PSR-17)
use Nyholm\Psr7\Factory\Psr17Factory;
$psr17Factory = new Psr17Factory();
$request = $psr17Factory->createRequest('GET', 'https://example.com');
Always prefer injecting Psr\Http\Factory\ServerRequestFactoryInterface, RequestFactory, etc., and use widely supported implementations like nyholm/psr7 or laminas/laminas-diactoros.
Http\Message\Factory\RequestFactory, double-check your dependencies — they likely stem from outdated HTTPlug or Symfony components. Update to Symfony HttpClient 5+ or use PSR-17 directly.psr/http-message:^1.0 || ^2.0), but mismatched PSR-7 versions in your stack can cause runtime errors. Verify all dependencies use the same PSR-7 version.Http\Message\FactoryInterface aliases — review service definitions for deprecated bindings and replace them with PSR-17 equivalents (e.g., Psr\Http\Message\ServerRequestFactoryInterface).php-http/message, php-http/guzzle6-adapter). Check those for factory logic if error messages reference factory methods.How can I help you explore Laravel packages today?