FrankenPHP, sessions in Materia KV, lifecycle: what will change in PHP on Clever Cloud

Since the first week of the year, we've delivered. There have been many new features on Clever Cloud, some more visible than others.

While we’ll have a detailed look at all of this in future articles (you can get a glimpse of it in our public changelog), there’s one subject that’s close to our heart: our images.

Redesigning images

Each time you deploy an add-on or application on our platform, our orchestrator provides you with a virtual machine based on Exherbo Linux, for which we have built the kernel and binaries specifically to guarantee a classic, high-performance, up-to-date and secure GNU/Linux environment. This environment is configured in a standard way, mainly via environment variables.

This minimal system, specific to our needs and ready to be configured, makes up what we call our images. Over the past few months, we’ve radically changed the way we design them. Until now, we had different images for each of our runtimes/languages, or almost all of them. Updating and testing images was sometimes complex and very manual. So we simplified and automated all of this.

For several weeks now, we’ve had regularly-generated image, which differs very little according to needs, and which we put through a battery of drastic tests to ensure that any application will deploy smoothly as it evolves. Implementation has been smooth over the months, and we are now at the end of a process that has been transparent to all our customers.

Why tell you about it today? Because it’s what will enable us to gradually review and improve the way you deploy applications on Clever Cloud. We’ve already laid a few building blocks here and there, like the integration of uv for Python, for example. But things are going to change much more significantly over the coming months and through 2025. One of our biggest runtimes is PHP.

PHP 8.4, sessions in Materia KV

Our discussions with the community at last year’s PHP Forum gave us the opportunity to think about how we could improve things. One of the recurring requests was for us to be more responsive in our support for new versions of PHP. The changes we’ve made will enable us to test the move to PHP 8.4, expected at the end of November, more quickly. Once it’s been validated and integrated into Clever Cloud, you’ll be able to activate it via a simple environment variable update.

The flexibility of PHP sessions was also a recurring topic. Currently, they can rely on local persistent storage or a Redis database linked to your application. This summer, we worked to tailor our Materia KV technology to this need. A few days ago, we put a new version into production, with support for expiring keys and commands enabling it to be supported transparently for users.

This is quite simple: retrieve the above repository content with git, Clever Tools, then create a PHP application as if it were to host its sessions on a Redis database, the code is identical:

clever create -t php --alias phpSessions
clever env set ENABLE_REDIS "true"
clever env set SESSION_TYPE "redis"

Once done, create a Materia KV add-on and link it to the application you’ve just created:

clever addon create kv phpSessionsKV --link phpSessions

After that, just deploy the application, and in a few seconds you’ll have the expected result, taking advantage of everything that goes with the Clever Cloud platform: keeping it up and running, domains and TLS certificates management, logs, metrics, and so on.

clever deploy & clever open

How did we achieve this? When we designed Materia KV, we set out to create a different kind of key-value database, complementary to our current offering. It is therefore distributed and highly resilient (the data is written in three of our data centers in Paris), but can be used almost seamlessly, since it is compatible with existing ecosystems.

For example, it currently supports the protocol on which Redis is based, and can be used with similar commands or clients such as iredis, redis-cli, valkey-cli, graphical interfaces, etc. We will shortly be adding Dynamo DB and GraphQL.

Franken PHP, better deployment

Another topic close to our hearts is the integration of Franken PHP, developed by our friends and partners at Les Tilleuls. Mixing PHP with a Caddy web server in a rather elegant and unusual way, this solution allows us to think differently about the deployment and configuration of PHP applications, and is increasingly appealing in this ecosystem, which has largely regained vitality in recent years.

We tested it on Clever Cloud, and explained to some customers how to deploy it, via Docker or natively. Above all, we wanted to go one step further and integrate it directly into our images, to simplify its use within our platform. This will soon be the case, thanks to our work on simplifying and redesigning our images. At the same time, we’ll be gradually improving our deployment of PHP.

At the moment, we’re operating on the basis of the language’s legacy, some of which dates back to versions 5.x or 7.x, which can sometimes hold us back in the developments we’d like to implement. After the release of PHP 8.4, we’re going to stick to the “historical” operation of our PHP image, so that our customers can benefit from stability in the deployment of their applications.

But most of all, it will enable us to reinvent some areas by focusing on actively supported versions of PHP, with clear management of application and runtime lifecycles. We’ll tell you more about this plan later in the year.

Let’s discuss at PHP Forum

As you may have gathered, the PHP community is very important to us. That’s why we’re partnering with AFUP again this year. We’ll be present at the 2024 PHP Forum being held on October 10 and 11 at the New York Hotel in Disneyland Paris. Don’t hesitate to come and chat with us, we’ll have a few surprises and exclusives to show off on site. It will also be an opportunity for you to share your feedback and requests. Because that’s how we want to build the future of Clever Cloud: together.

Blog

À lire également

Clever Tools: a year of enhancements for your deployments, on the road to v4

A command line interface (CLI) is at the core of developer experience. At Clever Cloud, we have been providing Clever Tools for almost 10 years.
Engineering Features

Otoroshi with LLM: simplify your API and AI service management on Clever Cloud

Your applications and services are evolving in an increasingly complex environment, requiring effective management of APIs and interactions with artificial intelligence models such as the very popular LLMs (Large Language Models).
Features

Markitdown-as-a-Service: from AI to production on Clever Cloud

Every day, new tools are released, AI brings new perspectives, you have new ideas. It's one of Clever Cloud's missions to help you to develop and test them in real-life conditions, effortlessly, before making them available to everyone.
Engineering