|
| 1 | +# FrankenPHP: App Server moderno per PHP |
| 2 | + |
| 3 | +<h1 align="center"><a href="https://frankenphp.dev"><img src="../../frankenphp.png" alt="FrankenPHP" width="600"></a></h1> |
| 4 | + |
| 5 | +FrankenPHP è un server di applicazioni per PHP costruito sul server web [Caddy](https://caddyserver.com/). |
| 6 | + |
| 7 | +FrankenPHP dà superpoteri alle app PHP grazie alle sue straordinarie funzionalità: [_Early Hints_](https://frankenphp.dev/docs/early-hints/), [modalità worker](https://frankenphp.dev/docs/worker/), [funzionalità in tempo reale](https://frankenphp.dev/docs/mercure/), [ricaricamento a caldo](https://frankenphp.dev/docs/hot-reload/), supporto automatico HTTPS, HTTP/2 e HTTP/3... |
| 8 | + |
| 9 | +FrankenPHP funziona con qualsiasi app PHP e rende i progetti Laravel e Symfony più veloci che mai grazie alle loro integrazioni ufficiali con la modalità worker. |
| 10 | + |
| 11 | +FrankenPHP può anche essere utilizzato come libreria Go autonoma per incorporare PHP in qualsiasi app utilizzando `net/http`. |
| 12 | + |
| 13 | +[**Ulteriori informazioni** su _frankenphp.dev_](https://frankenphp.dev) e in questa presentazione: |
| 14 | + |
| 15 | +<a href="https://dunglas.dev/2022/10/frankenphp-the-modern-php-app-server-written-in-go/"><img src="https://dunglas.dev/wp-content/uploads/2022/10/frankenphp.png" alt="Slides" width="600"></a> |
| 16 | + |
| 17 | +## Per iniziare |
| 18 | + |
| 19 | +### Script di installazione |
| 20 | + |
| 21 | +Su Linux e macOS, copiare questa riga nel terminale per installare automaticamente |
| 22 | +una versione adatta alla piattaforma usata: |
| 23 | + |
| 24 | +```console |
| 25 | +curl https://frankenphp.dev/install.sh | sh |
| 26 | +``` |
| 27 | + |
| 28 | +Su Windows, eseguire in PowerShell: |
| 29 | + |
| 30 | +```powershell |
| 31 | +irm https://frankenphp.dev/install.ps1 | iex |
| 32 | +``` |
| 33 | + |
| 34 | +### Binario autonomo |
| 35 | + |
| 36 | +Forniamo i binari FrankenPHP per Linux, macOS e Windows |
| 37 | +con [PHP 8.5](https://www.php.net/releases/8.5/). |
| 38 | + |
| 39 | +I binari Linux sono collegati staticamente, quindi possono essere utilizzati su qualsiasi distribuzione Linux senza installare alcuna dipendenza. Anche i file binari di macOS sono autonomi. |
| 40 | +Contengono le estensioni PHP più popolari. |
| 41 | +Gli archivi di Windows contengono il binario PHP ufficiale per Windows. |
| 42 | + |
| 43 | +[Scaricare FrankenPHP](https://github.com/php/frankenphp/releases) |
| 44 | + |
| 45 | +### Pacchetti rpm |
| 46 | + |
| 47 | +I nostri manutentori offrono pacchetti rpm per tutti i sistemi che utilizzano `dnf`. Per installare, eseguire: |
| 48 | + |
| 49 | +```console |
| 50 | +sudo dnf install https://rpm.henderkes.com/static-php-1-0.noarch.rpm |
| 51 | +sudo dnf module enable php-zts:static-8.5 # sono disponibili da 8.2 a 8.5 |
| 52 | +sudo dnf install frankenphp |
| 53 | +``` |
| 54 | + |
| 55 | +**Installazione delle estensioni:** `sudo dnf install php-zts-<extension>` |
| 56 | + |
| 57 | +Per le estensioni non disponibili per impostazione predefinita, utilizzare [PIE](https://github.com/php/pie): |
| 58 | + |
| 59 | +```console |
| 60 | +sudo dnf install pie-zts |
| 61 | +sudo pie-zts install asgrim/example-pie-extension |
| 62 | +``` |
| 63 | + |
| 64 | +### Pacchetti deb |
| 65 | + |
| 66 | +I nostri manutentori offrono pacchetti deb per tutti i sistemi che utilizzano `apt`. Per installare, eseguire: |
| 67 | + |
| 68 | +```console |
| 69 | +VERSION=85 # sono disponibili da 82 a 85 |
| 70 | +sudo curl https://pkg.henderkes.com/api/packages/${VERSION}/debian/repository.key -o /etc/apt/keyrings/static-php${VERSION}.asc |
| 71 | +echo "deb [signed-by=/etc/apt/keyrings/static-php${VERSION}.asc] https://pkg.henderkes.com/api/packages/${VERSION}/debian php-zts main" | sudo tee -a /etc/apt/sources.list.d/static-php${VERSION}.list |
| 72 | +sudo apt update |
| 73 | +sudo apt install frankenphp |
| 74 | +``` |
| 75 | + |
| 76 | +**Installazione delle estensioni:** `sudo apt install php-zts-<extension>` |
| 77 | + |
| 78 | +Per le estensioni non disponibili per impostazione predefinita, utilizzare [PIE](https://github.com/php/pie): |
| 79 | + |
| 80 | +```console |
| 81 | +sudo apt install pie-zts |
| 82 | +sudo pie-zts install asgrim/example-pie-extension |
| 83 | +``` |
| 84 | + |
| 85 | +### Pacchetti apk |
| 86 | + |
| 87 | +I nostri manutentori offrono pacchetti apk per tutti i sistemi che utilizzano `apk`. Per installare, eseguire: |
| 88 | + |
| 89 | +```console |
| 90 | +VERSION=85 # sono disponibili da 82 a 85 |
| 91 | +echo "https://pkg.henderkes.com/api/packages/${VERSION}/alpine/main/php-zts" | sudo tee -a /etc/apk/repositories |
| 92 | +KEYFILE=$(curl -sJOw '%{filename_effective}' https://pkg.henderkes.com/api/packages/${VERSION}/alpine/key) |
| 93 | +sudo mv ${KEYFILE} /etc/apk/keys/ && |
| 94 | +sudo apk update && |
| 95 | +sudo apk add frankenphp |
| 96 | +``` |
| 97 | + |
| 98 | +**Installazione delle estensioni:** `sudo apk add php-zts-<extension>` |
| 99 | + |
| 100 | +Per le estensioni non disponibili per impostazione predefinita, utilizzare [PIE](https://github.com/php/pie): |
| 101 | + |
| 102 | +```console |
| 103 | +sudo apk add pie-zts |
| 104 | +sudo pie-zts install asgrim/example-pie-extension |
| 105 | +``` |
| 106 | + |
| 107 | +### Homebrew |
| 108 | + |
| 109 | +FrankenPHP è disponibile anche come pacchetto [Homebrew](https://brew.sh) per macOS e Linux. |
| 110 | + |
| 111 | +```console |
| 112 | +brew install dunglas/frankenphp/frankenphp |
| 113 | +``` |
| 114 | + |
| 115 | +**Installazione delle estensioni:** utilizzare [PIE](https://github.com/php/pie). |
| 116 | + |
| 117 | +### Utilizzo |
| 118 | + |
| 119 | +Per servire il contenuto della cartella corrente, eseguire: |
| 120 | + |
| 121 | +```console |
| 122 | +frankenphp php-server |
| 123 | +``` |
| 124 | + |
| 125 | +Si possono anche eseguire script da riga di comando con: |
| 126 | + |
| 127 | +```console |
| 128 | +frankenphp php-cli /path/to/your/script.php |
| 129 | +``` |
| 130 | + |
| 131 | +Per i pacchetti deb e rpm, si può anche avviare il servizio systemd: |
| 132 | + |
| 133 | +```console |
| 134 | +sudo systemctl start frankenphp |
| 135 | +``` |
| 136 | + |
| 137 | +### Docker |
| 138 | + |
| 139 | +In alternativa, sono disponibili [Immagini Docker](https://frankenphp.dev/docs/docker/): |
| 140 | + |
| 141 | +```console |
| 142 | +docker run -v .:/app/public \ |
| 143 | + -p 80:80 -p 443:443 -p 443:443/udp \ |
| 144 | + dunglas/frankenphp |
| 145 | +``` |
| 146 | + |
| 147 | +Aprire `https://localhost` e buon divertimento! |
| 148 | + |
| 149 | +> [!TIP] |
| 150 | +> |
| 151 | +> Non tentare di utilizzare `https://127.0.0.1`. Usare `https://localhost` e accettare il certificato autofirmato. |
| 152 | +> Utilizzare la [variabile di ambiente `SERVER_NAME`](/docs/it/config.md#variabili-dambiente) per modificare il dominio da utilizzare. |
| 153 | +
|
| 154 | +## Documentazione |
| 155 | + |
| 156 | +- [Modalità classica](https://frankenphp.dev/docs/classic/) |
| 157 | +- [Modalità worker](https://frankenphp.dev/docs/worker/) |
| 158 | +- [Migrazione da Nginx/PHP-FPM](https://frankenphp.dev/docs/migrate/) |
| 159 | +- [Supporto per Early Hints (codice di stato HTTP 103)](https://frankenphp.dev/docs/early-hints/) |
| 160 | +- [Real time](https://frankenphp.dev/docs/mercure/) |
| 161 | +- [Log](https://frankenphp.dev/docs/logging/) |
| 162 | +- [Ricarica a caldo](https://frankenphp.dev/docs/hot-reload/) |
| 163 | +- [Gestione efficiente di grossi file statici](https://frankenphp.dev/docs/x-sendfile/) |
| 164 | +- [Configurazione](https://frankenphp.dev/docs/config/) |
| 165 | +- [Scrittura delle estensioni PHP in Go](https://frankenphp.dev/docs/extensions/) |
| 166 | +- [Immagini Docker](https://frankenphp.dev/docs/docker/) |
| 167 | +- [Deploy in produzione](https://frankenphp.dev/docs/production/) |
| 168 | +- [Ottimizzazione delle prestazioni](https://frankenphp.dev/docs/performance/) |
| 169 | +- [Creare app PHP **autonome** e autoeseguibili](https://frankenphp.dev/docs/embed/) |
| 170 | +- [Creare file binari statici](https://frankenphp.dev/docs/static/) |
| 171 | +- [Compilare da sorgente](https://frankenphp.dev/docs/compile/) |
| 172 | +- [Osservabilità](https://frankenphp.dev/docs/observability/) |
| 173 | +- [Integrazione WordPress](https://frankenphp.dev/docs/wordpress/) |
| 174 | +- [Integrazione Symfony](https://frankenphp.dev/docs/symfony/) |
| 175 | +- [Integrazione Laravel](https://frankenphp.dev/docs/laravel/) |
| 176 | +- [Problemi noti](https://frankenphp.dev/docs/known-issues/) |
| 177 | +- [App demo (Symfony) e benchmark](https://github.com/dunglas/frankenphp-demo) |
| 178 | +- [Documentazione della libreria Go](https://pkg.go.dev/github.com/dunglas/frankenphp) |
| 179 | +- [Contributi e debug](https://frankenphp.dev/docs/contributing/) |
| 180 | +- [Interni (panoramica dell'architettura)](/docs/internals.md) |
| 181 | + |
| 182 | +## Esempi e scheletri |
| 183 | + |
| 184 | +- [Symfony](https://frankenphp.dev/docs/symfony/) |
| 185 | +- [API Platform](https://api-platform.com/docs/symfony) |
| 186 | +- [Laravel](https://frankenphp.dev/docs/laravel/) |
| 187 | +- [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp) |
| 188 | +- [WordPress](https://github.com/StephenMiracle/frankenwp) |
| 189 | +- [Drupal](https://github.com/dunglas/frankenphp-drupal) |
| 190 | +- [Joomla](https://github.com/alexandreelise/frankenphp-joomla) |
| 191 | +- [TYPO3](https://github.com/ochorocho/franken-typo3) |
| 192 | +- [Magento2](https://github.com/ekino/frankenphp-magento2) |
0 commit comments