در حال بارگذاری ...

Finding PHP 8 via Homebrew0:00

Before we can play around, of course we need to install php8. Right now I have 7.4. So at the time of this recording, it might be a little tricky. Normally, I would use Homebrew. And if we look for php, you'll see, yeah, no reference to php8 just yet. But if you're watching this, you likely will come across it. And if you'd like to learn more about Homebrew, search brew.sh. Instead, let's look for homebrew.php8. All right, it looks like we have a repo that will add support, including php8. All right, let's give this a shot.

Tapping Repo and Installing0:30

All right, it looks like we have a repo that will add support, including php8. All right, let's give this a shot. Otherwise, you might reach for something like Docker, if you're familiar with it. We'll update brew. Okay, good to go. Next, let's tap this formula. All right. And then we can install our version like this. All right, cross your fingers. And there we go.

Handling Keg-Only PHP0:56

All right, cross your fingers. And there we go. But real quick, notice it is keg only, which means it was not symlinked, which means if I open a new tab, it probably won't show. Yeah, but we can find it. Here's the full path. And there we go, php8. So let's play around. I'll make a directory called php8 and open this in my editor. All right, index.php.

Setting Interpreter and Testing1:17

I'll make a directory called php8 and open this in my editor. All right, index.php. And let's echo the php version and give this a run. Now, for this series, I'm going to set the interpreter to 8.0. And then for the CLI, I'll paste that in, and we'll call it php8. Give it a run, and there you go. We're ready to get started.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟