Skip to content
Episode #55: Serverless PHP using Bref with Matthieu Napoli episode artwork

EPISODE · Jun 29, 2020 · 38 MIN

Episode #55: Serverless PHP using Bref with Matthieu Napoli

from Serverless Chats · host Jeremy Daly & Rebecca Marshburn

About Matthieu Napoli: Matthieu Napoli is a software consultant and founder of null. Matthew has been developing web applications for more than 10 years with PHP and JavaScrapt as a full-stack developer, lead dev, and CTO, while maintaining several open source projects. He’s also the author of PHP-DI, Silly, Couscous, and Bref. Twitter: twitter.com/matthieunapoli Personal website: mnapoli.fr null: null.tc Bref: bref.sh Serverless PHP Newsletter: serverless-php.news Watch this episode on YouTube: https://youtu.be/H8tkZcjQxOA Transcript Jeremy: Hi everyone. I'm Jeremy Daly, and this is Serverless Chats. Today, I'm chatting with Matthieu Napoli. Hey Matthieu. Thanks for joining me. Matthieu: Hi, thanks for having me. Jeremy: You are a serverless consultant and the founder of Null. Why don't you tell the listeners a little bit about your background and what Null does? Matthieu: Yes. I created Null two years ago. My goal was to be able to both work in open source as well as work for clients. I use that company to do trainings around Bref, around serverless and also to provide consulting services. Jeremy: What about your background? Matthieu: I started as a developer about 10 years ago, and I've been working mostly as a developer. I've been configuring servers, setting up servers for a while. That's why I'm also really interested in serverless. I've been looking at that very closely lately. Jeremy: Great. All right. I want to talk to you today about serverless and PHP and Bref. Serverless is obviously the topic of this podcast. We've seen quite a bit of movement in the serverless space over the course of the last five years or so. PHP sometimes gets some slack on the internet, but can you give me a brief background as to why you chose PHP? Matthieu: Yes. That's a very good question and that's a good way to start, because indeed a lot of people have opinions about PHP, and sometimes for good reason. I started with PHP just because it was simple. That's what I love about this language. At the time, like when PHP arrived, it was about 25 years ago. The web was about creating CGI applications, using C or whatever, and PHP arrived and simplified everything. It made the web accessible to a lot of people. I find that really amazing. That's why I started with PHP as well. I wanted to build a simple website. Yeah. I started with PHP because of that, but I'm seeing the same thing today with serverless. It's making infrastructure, it's making hosting applications accessible again to developers and I find that amazing. Yeah. I started with PHP. I kind of got stuck with this language throughout my jobs and lately PHP has become a very interesting language. To be honest, it's really interesting. If you've used PHP in the past, I really encourage you to give it another look. It's really worth it. While I do talk a lot and use a lot of PHP, I enjoy using JavaScript as well. TypeScript lately. Really, really interesting language. Life is full of things to learn about, I guess. Jeremy: Right. Absolutely. I agree with you on PHP. I started with PERL and CGI way, way back when, and then I think I started using PHP 3.0 or something like that with MySQL databases. You're right. It completely changed things. From that we got WordPress for better or for worse, but I think that like 80% of the web runs on PHP. Matthieu: Yeah. That's a huge market, which is interesting when we're going to talk about AWS Lambda later. Yeah. PHP is huge and I don't think this is something that we can ignore. Jeremy: Right. Right. Okay. Speaking of this PHP, you realized that there was a gap in the serverless ecosystem for PHP, and so you wrote something called Bref. Can you tell the listeners what that's all about? Matthieu: Exactly. Yes. I am a developer. I like writing code, creating applications. I don't like setting up servers and all of that stuff. This is why I created Bref. I wanted a simple way to put my PHP code online. At the time I was looking into serverless, looking into AWS Lambda and I discovered, of course, that AWS Lambda does not support PHP. I created Bref to bridge the gap, run PHP on Lambda and provide a lot of tools, documentation, examples. Yeah. Anything that you may lack to create those serverless applications. I would say that Bref is more than just a runtime. It's a whole stack. Jeremy: Right. There's actually two parts of Bref, right? Why don't you explain those two different parts? Matthieu: Yeah. I realized over time that there are two major use cases when you look at Bref and what you can do with PHP on Lambda. In the first case, you know about AWS Lambda. You know how it works. You know why you use it. The only thing that's missing is that you want to run PHP for some reason. Maybe you want to use PHP and you want to run it on Lambda. The first part of Bref is a runtime that works just like any other language on Lambda. Yeah. You can write functions in PHP, handle queue messages, SQS queue messages, EventBridge messages react to S3 events, API gateway events as well. You know, the usual. The second use case is different. Instead of adapting PHP to run on Lambda, there are people that know PHP and do not really know about Lambda and what they can do with it. I take it the other way around and I adapt Lambda to PHP. The approach is that users don't have to change anything in their code. They can take their Laravel application, Symfony application or whatever, and hopefully put it in Lambda and it just works. That's a second runtime. This runtime, I mean, we can go into the details. It's really interesting because the way PHP runs is very similar to how AWS Lambda runs. Making the old PHP way run on Lambda was fairly ... I mean, I don't want to say easy, but it was doable. That's the second approach where, well, people can just start using Lambda as a web host. That's how I host Lambda as a web host instead of functions. Jeremy: Sure. Right. The custom runtime for just the first part of it, so just being able to run PHP on Lambda, this is something that's really interesting because I know there are others that maintain PHP runtimes out there. You are optimizing it for actual PHP developers, right? You're using PHP-FPM, right? Matthieu: Exactly. Yes. The FPM runtime, so that the FPM runtime is used for the use case where you want to use AWS Lambda as a web hosting platform. The FPM runtimes actually runs PHP-FPM, which is like PHP web server inside Lambda. Bref has a little bridge that when there is an API gateway event, will take the event, convert it into a request that PHP-FPM understands. This is the first CGI protocol and so Bref does the bridge, provides the first CGI request to PHP. Then PHP runs just as usual. You know, the PHP execution model is you have a request, a PHP process starts, builds the whole framework, runs the request, processes the request, and returns the response and then `. I mean, this is perfect for AWS Lambda. That's why it's quite easy to integrate FPM with Lambda. Jeremy: Right. Then you have the ability to actually create individual handlers as functi...

Episode metadata supplied by the publisher feed · Published Jun 29, 2020

Embed this episode

In this episode, Jeremy chats with Matthieu Napoli about why PHP is still an important part of the web landscape, how Bref can help you make existing PHP workloads serverless, and whether or not PHP devs will embrace serverless design patterns.

Distinct summary based on available episode metadata or transcript content.

Ready to play

Episode #55: Serverless PHP using Bref with Matthieu Napoli

0:00 38:50

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

Evolving with Georgia May Georgia May Change is the only constant. Evolving explores the beauty and uncertainty of self-discovery. This podcast is a space for learning and unlearning, shedding old layers, leaping into transformation and embracing the unknown. There is no final destination. This show is for those who are committed to the lifelong journey of discovery; it's time to reinvent yourself, while simultaneously returning to who you’ve always been. Note: This podcast was previously known as Life Chats, where well-known and everyday individuals shared their real life stories, hosted by journalist Georgia May. Enjoy the catalogue of inspiring episodes! This Social Cottage Gemma Watts Welcome to This Social Cottage: the podcast for business owners, content creators, experts and solopreneurs who want to grow on Instagram, sell their offers daily, and still have time for the life they actually want to live. Hosted by ex-teacher and Instagram strategist and offer strategist Gemma, each episode is packed with strategy, content clarity, and sustainable growth tips to help you build an online presence without being exhausted by it. Whether you’re: Just getting started with posting and feeling overwhelmed, Already creating content but it’s taking forever, or Craving a sustainable way to sell your expert offers daily... This podcast is your space. You’ll hear solo episodes full of no-fluff Instagram growth tips, content creation strategies, and ways to show up as the expert you already are — even when life is chaotic and motherhood is... motherhood-ing. Plus, guest chats with women who are doing business with heart, clarity, and Autistic Voices Evalynne Charmer - Autistic Voices Autistic Voices is an authentic and insightful podcast series that explores the world of autism and neurodiversity through the voices of those who know it best - autistic individuals. Join therapist and fellow autist, Evalynne Charmer, as she chats with guests about their experiences with autism and rethinks common misconceptions about neurodiversity. From challenges to triumphs, each episode of Autistic Voices provides a unique perspective on autistic lives. Tune in now to hear these authentic autistic voices! Choosing Change Podcast Lizzie Moult The Choosing Change podcast reveals our greatest life lessons and the small adjustments we make that have a big impact on our life. Hosted by Lizzie Moult, an Aussie cognitive behavioural therapist living in the Scottish Highlands. She chats with incredible people who share their challenges and personal experiences. Whether you're looking for a boost of inspiration, or practical tips to help you create a more fulfilling life, the Choosing Change podcast has something for you. It's your choice, ordinary or extraordinary.#choosingchangepodastwww.choosingchangepodcast.co.ukwww.lizziemoult.com/podcast

Frequently Asked Questions

How long is this episode of Serverless Chats?

This episode is 38 minutes long.

When was this Serverless Chats episode published?

This episode was published on June 29, 2020.

Can I download this Serverless Chats episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!