Download the PHP package mrizwan/laravel-fcgi-client without Composer

On this page you can find all versions of the php package mrizwan/laravel-fcgi-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-fcgi-client

Laravel FastCGI Client

A modern, Laravel-style FastCGI client that lets your Laravel application communicate directly with FastCGI-compatible servers like PHP-FPM.

The package works similarly to Laravel's HTTP Facade

Acknowledgements

This package is built as a fork of the fast-cgi-client library originally authored by hollodotme. We've adapted and extended it to provide seamless integration with Laravelβ€”many thanks to the original author for creating such a solid foundation.

What is FastCGI?

FastCGI is a protocol that allows a web server (like Nginx or Apache) to communicate with external applications, typically programming language interpreters like PHP-FPM (PHP FastCGI Process Manager). It's an improvement over the older CGI protocol, offering better performance through persistent processes.

In a traditional PHP web application setup, the web server (e.g., Nginx) receives HTTP requests and forwards them to PHP-FPM via FastCGI, which then executes the PHP scripts and returns the results.

Where This Package Can Be Used

This package enables Laravel applications to directly communicate with PHP-FPM, which opens up several use cases:

  1. Microservices Architecture: Directly communicate with other PHP-based microservices without going through HTTP, reducing overhead.

  2. Private API Access: Access internal APIs on remote servers via FastCGI instead of exposing them through HTTP endpoints.

  3. Cross-Application Communication: Call scripts on another PHP application from your Laravel app with lower latency than HTTP requests.

  4. Gateway/Proxy Services: Create gateway services that can route requests to appropriate backend PHP services.

πŸš€ Installation

πŸ”§ Configuration

The package automatically registers the service provider and facade in Laravel 9.x and above.

You can use the facade in your code by importing it:

βœ… Basic Usage

Simple GET Request

POST Request with Data

JSON Request

Defaults:

πŸ“‘ Available Methods

HTTP Methods

All HTTP methods support Laravel-like signatures with optional data arrays:

Request Configuration

Content Type Configuration

Authentication

Method Chaining

You can chain multiple methods together for cleaner code:

πŸ”— URL Templates

The package supports URL templates with parameter substitution:

🌐 Response API

The response object provides a rich API similar to Laravel's HTTP client:

πŸ” Concurrent Requests with Laravel's Concurrency Facade

For Laravel 11+, you can use Laravel's built-in Concurrency facade to execute multiple FastCGI requests in parallel:

Moore Examples

Accessing a Remote API with URL Templates

Submitting a Form to a Remote Application

Creating a Resource on a Remote Service

RESTful API with URL Templates

Fetching Data from Multiple Services

Smart Content Type Defaults

The package intelligently chooses content types based on the HTTP method:

Error Handling

The package provides several ways to handle errors:

Retry Logic

For unstable services or network connections, you can add retry logic with intelligent defaults:

πŸ§ͺ Testing

Tests are written using Pest PHP. Run them with:

πŸ“œ License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-fcgi-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version >=9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mrizwan/laravel-fcgi-client contains the following files

Loading the files please wait ...