Aller au contenu
FrankenPHP
Esc
↑↓naviguer↵ouvrir⌘Japerçu

Le serveur d'applications PHP moderne, écrit en Go

FrankenPHP est un nouveau serveur d'applications pour les applications PHP (construit sur la base de Caddy) et une bibliothèque permettant d'incorporer l'interpréteur PHP dans les serveurs web Go.

curl https://frankenphp.dev/install.sh | sh
Commencer
  • Support natif pour
  • Drupal
  • Sulu
  • WordPress
  • Laravel
  • Symfony
  • API Platform
  • Magento

Commencez dès maintenant !

Lancez un serveur PHP de haute qualité en production en une simple commande !

# Installer FrankenPHP sous Linux ou macOS
curl https://frankenphp.dev/install.sh | sh

# Ou sous Windows, avec PowerShell
irm https://frankenphp.dev/install.ps1 | iex

# Servir le répertoire public/
frankenphp php-server -r public/

# Exécuter un script en ligne de commande
frankenphp php-cli script.php

Mode Worker

The FrankenPHP mascot in a hard hat, driving an excavator

public/index.php

<?php
// Boot your app once
require __DIR__.'/vendor/autoload.php';
$app = new \App\Kernel();
$app->boot();

$handler = static function () use ($app) {
    echo $app->handle($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER);
};

// …then serve request after request
while (\frankenphp_handle_request($handler)) {
    gc_collect_cycles();
}
  • Script Worker

    Démarrez votre application une fois, elle reste en mémoire !

  • Direct

    Pris en charge nativement par Symfony, API Platform, Laravel...

  • Simple

    Utilise les superglobales classiques : pas besoin de PSR-7.

  • Rapide

    3,5 fois plus rapide que FPM sur les applications API Platform selon nos benchmarks.

  • Efficace

    FrankenPHP est écrit en Go et C. Il s'appuie sur la fonctionnalité emblématique de Go : les goroutines !

  • Optionnel

    Votre application peut être servie telle quelle, même si elle n'est pas compatible avec le mode worker.

  • Déploiement facile

    Fonctionne en processus : un binaire, aucun service externe nécessaire.

  • Watcher

    Le worker redémarre à chaque changement de votre code.

Read the worker docs →

Caddyfile

localhost {
    # Activer la compression (optionnel)
    encode zstd br gzip
    # Exécuter les fichiers PHP dans le répertoire courant et servir les ressources
    php_server
}

Une simplicité de configuration

Trois lignes de configuration : c'est tout ce dont vous avez besoin pour démarrer un serveur PHP de niveau production (HTTPS automatique, HTTP/3, compression Brotli...), alimenté par Caddy.

  • HTTPS ✓
  • HTTP/3 ✓
  • zstd · br · gzip ✓
  • Early Hints ✓
Documentation →

FrankenPHP en un aperçu

The FrankenPHP elephant and the Go gopher in a laboratory, lightning crackling between them
Go + C + PHP

Born in a lab. Written in Go.

FrankenPHP is a Caddy module and a library: embed the PHP interpreter in any Go program and serve PHP scripts through net/http.

server, _ := frankenphp.NewServer("public/")
frankenphp.Init(frankenphp.WithServer(server))
defer frankenphp.Shutdown()

http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
    server.ServeHTTP(w, r)
})
Use FrankenPHP as a Go library →

Plus moderne que jamais !

  • Utilise l'exécuteur PHP officiel intégré dans un serveur web de pointe : Caddy
  • Support natif pour HTTP/1.1, HTTP/2 et HTTP/3
  • Génération et renouvellement automatiques des certificats HTTPS (Let's Encrypt ou ZeroSSL)
  • Copie vos fichiers PHP dans la racine du document, et c'est tout !
  • Crée des binaires autonomes, auto-exécutables et sans dépendances pour vos applications web PHP, et outils en ligne de commande.
  • Les extensions PHP les plus populaires, incluant OPcache et XDebug, sont nativement supportées.
Essayez FrankenPHP
The FrankenPHP mascot hugging a big red heart

Need a hand? We've got heart.

Les-Tilleuls.coop, the cooperative behind FrankenPHP, helps teams migrate, host and speed up their PHP apps.