Laboratorio NetForgeNetForge labpiù versioni di PHPmultiple PHP versions
Tre versioni di PHP, un serverThree PHP versions, one server
Con arx la versione di PHP la sceglie il sito, non il server. Qui ne girano tre insieme: apri ognuna e guarda la stessa pagina eseguita da un PHP diverso.
With arx the PHP version is chosen by the site, not by the server. Three of them run side by side here: open each one and see the same page run by a different PHP.
Le versioniThe versions
Tutte con aggiornamenti di sicurezza. Le versioni fuori supporto, come la 7.4 o la 8.1, arx le installa lo stesso, ma su un server pubblico non conviene. Questa pagina gira su PHP 8.4.
All still get security fixes. Unsupported versions such as 7.4 or 8.1 can be installed too, but are not wise on a public server. This page runs on PHP 8.4.
Come funzionaHow it works
Debian offre una sola versione di PHP per release. arx aggiunge il repository Sury, che ne offre molte, installabili una accanto all'altra.
Ogni sito ha il suo pool PHP-FPM, con il suo utente di sistema e il suo socket. La versione è una proprietà del sito.
Per cambiarla basta il pannello. arx crea il pool nuovo, sposta nginx sul nuovo socket e controlla che nginx accetti la configurazione; solo dopo toglie il pool vecchio. Se qualcosa va storto, il sito torna com'era.
A cosa serve: un'applicazione vecchia che non regge la versione nuova resta dov'è, mentre i siti nuovi usano l'ultima. Sullo stesso server.
Debian ships one PHP version per release. arx adds the Sury repository, which offers many, installable side by side.
Every site has its own PHP-FPM pool, with its own system user and socket. The version is a property of the site.
Changing it takes the panel. arx creates the new pool, points nginx at the new socket and checks that nginx accepts the configuration; only then does it remove the old pool. If anything goes wrong, the site goes back to how it was.
What it is for: an old application that cannot take the new version stays where it is, while new sites use the latest. On the same server.
Controllalo da teCheck it yourself
for v in 83 84 85; do curl -s "https://php$v.selif.org/?v"; done