[BLANK_AUDIO]
Hello everybody. I am having some audio problems today. My little configuration that allows you to
listen to the background music doesn't seem to be working, which is mildly annoying.
So I'm going to just try and switch it over quickly.
When I do that, the music just goes dead, which it shouldn't do.
And I have no idea why that's happening, which honestly is terrible.
So we're going to have to do the live stream without background music today.
So if you're joining, I apologize for there being a lack of background music.
You are welcome to play your own background music while we work on this.
I just don't have time to debug it right now.
Kind of annoying if I'm honest. Anyway. All right. So last week.
Oh, wait. I forgot to put my little sign up. I'll be right back.
I forget that every time.
Okay. So last week, cut out of this. I don't know why this isn't working.
Mac probably updated something. Last week, we found this issue, which I found quite interesting.
It doesn't seem to be REST specific, but it does seem to be happening that it doesn't
log the details, the debug log file. So I'm going to today, I'm going to try
and configure xdebug in PHP storm for WPNV. I've never done this before. I do have
PHP storm configured for my personal local development environment, but I've never done it for
WPNV. So I'm going to try it today. Apparently, you turn it on by just adding the xdebug flag.
And with that flag enabled, you can then configure your IDE to listen for xdebug sessions.
So that's what I'm going to start by doing. I have also, I need to update my local WordPress
develop fork. So I'm working with the latest codes. I'm going to do that quickly now.
So this is my forked version of the code. I'm going to use this very awesome sync fork button
that GitHub gives me. It's one of my favorite things about GitHub now, is you can just sync
your fork with Trunk or Master, and it just works and it's done. There we go.
Latest code two hours ago. All good. And then once I do that, I need to
get the latest version of the code on my desktop. So I'm going to run git pull.
There's probably a way you can do this through some kind of git IDE, but I just couldn't be bothered.
All right. So we've got the latest code now. And now we need to start this thing up.
So I need to make sure Docker is running, which it is. That's good. I don't know why
Dscript is running. I'm going to quit out of that. I don't need text to be running,
so I'm going to quit out of that as well. I do randomly check what's running in my taskbar
and disable things just for fun. All right. So I'm going to go through this,
all these steps now quickly, just because I've got some new code.
So let's go npm install. I'm probably going to need to switch npm versions.
[VOCALIZING]
This could take a while, apparently.
I also minimize the camera overlay and the chat overlay so that it takes up less space.
So last week, somebody was saying they couldn't see the screen. So hopefully,
you're able to see everything that's going on on screen right now. So that all worked.
npm run bold dev.
So it was a good idea to run these commands when you just pull the latest code,
because you never know what's changed.
And then I'm going to be running npm run env start, but I'm probably going to need to
include the XD bug switch. It's going to be that one there.
npm run wpenv start. npm run env start. I guess wpenv start might work as well.
Theoretically, it should work. So let's try that.
[VOCALIZING]
Oh, OK. It doesn't work. So maybe if I just go env start with the XP debug switch.
Let's try that. npm run env start.
The next bug. Let's see if that works. OK.
I have no idea if that's working. I'm going to just have a look and see what the output says.
I do not know.
Oh, that's fun. We're getting an error.
All right. Let's try it without the XD bug switch and see if that works.
No, same error.
Drive available programming, similar connectivity, and endpoint blah.
Oh, oh, oh, oh, oh, I know what this is. This is because I'm running
the Learn WordPress code as well. No. And that also uses Docker, and I think there's a conflict
there somewhere. So should check with that command is. Yarn run env stop, and then yarn run.
Yeah, yarn run env stop should do it.
And then let's try
WordPress develop. Somebody asked me the other day.
I think it was in the chat or it was in a comment on YouTube
about the way that Docker is set up for these things. And I said, I'm afraid I don't know.
I don't use Docker. But yeah, it can be a bit wonky. Let's try that.
Okay, so that seems to have worked. Now, what I can do, what I think I can do now
is if I browse to there.
Okay, I should be able to enable my X debug extension. And then I should be able to use
this against this. But in PHP storm, there's a thing you can do where you can
test the PHP debug connection. So now I just need to find it.
Web server debug validation. That's what it is. So I guess it's a local web server or shared folder.
So let's pop that in there. And then let's get the path here.
And I think this works. Oh, did I do this at some point in the past?
Must have done. Okay, let's try it. Let's go validate. Specified URL is not reasonable.
Caused by request for all the status code. Oh, interesting.
What did I have in here? 27001. Yeah, now that's not going to work.
See what happens.
I wonder why PHP storm can't
access that URL. Okay, let's do some googling. I wonder if there's something in the read me.
No. All right.
This is just the read me.
Okay. Let's see what Google tells us. So
WordPress develop xdebug PHP storm.
There's probably nothing.
.903 path mappings.
Okay. I'm going to try something else. I'm going to try and just -- oh, wait.
Wait, wait, wait, wait, wait. I need to pass the source. That might be why.
The code is actually sitting in the source directory.
That might be why. No. Oh, something happened. Hey. Okay.
So the client host is unreachable. So no PHP, INI, the file was found.
Doesn't look like the debug extension is loaded. Okay. I wonder if we can test that
by just doing something as silly as putting a info.php in the source and browsing tools. Let's try that.
PHP info. I have no idea if this is going to work. But let's find out.
Okay. And theoretically, I should be able to go.
Yes. Yay. That works. Okay. So let's do an xdebug.
Hmm. Local PHP. So it looks like
xdebug might not be enabled.
Okay. So
WordPress develop, enable xdebug.
Okay. So my guess is that
this is not using -- this is probably using some kind of custom NPM
scripts setup. Let's go and have a look at that.
Is there anything here and here about xdebug?
Probably not.
Which one are we running? NPM run env start.
Env start runs local env script start.
Tools. Tools. Local env.
Hmm. There's a PHP config ini. I wonder if I can change those.
Okay.
The question is, is xdebug even installed?
See, it looks like WordPress develop is not using WPE env. It's just using a custom Docker environment.
So that means I need to install xdebug on the Docker environment first.
Okay.
Hmm.
It looks like we don't have xdebug available.
So I am not going to fiddle with getting it configured in this environment.
I'm very simply going to set up a local WordPress instance
and do it on my local which has xdebug installed. That's just going to be easier.
So let us stop all of this. I need to do some digging into how this all works.
So let's stop this for now.
And then I'm going to set up a local install on my personal local environment.
And I'm going to use the code but configure it in my environment.
So I did this in the very first session.
Where we had a problem with directories and things.
So basically
I'm going to
hit clone WordPress develop into here.
That's going to set up this project.
It's going to open this. So this is my local developer environment where I set up my sites.
There's the WordPress folder so let's open that. Yes.
That's going to pull all the code and then I just need to configure
the
virtual host to point to the source directory.
So let's wait for this to finish.
Okay. That's done. And then I need to...
So that's the name of the instance on my local environment.
Right. So I need to point this to the source directory.
And this is very specific to my local chosen environment.
Whatever you're using, you might have to do something different.
Yeah. Now that one. Okay.
And now if I browse to WordPress.test,
it's going to be that test site. Okay. It's going to ask me to run
this. Oh, I need to first the npm install. So let's exit out of here. npm install.
And that's the first time I'm doing this. So all these things are going to have to get installed.
I'm actually surprised it's not asking me to update my node version.
Interesting. Okay. And while that's doing its thing, if I create my new PHP info here,
I just want to check what version of PHP I'm running. I think it's going to be 8 point something,
which I might need to change.
So let's do that. Let's go. Oh, it was PHP info.
Road trip folks. If you ever create a PHP info file on the server,
make sure it's deleted afterwards. Okay. It's running 8 point one. So that should be okay.
We can always switch it to 7 point four or something if we need to.
All right. Okay. That's all run. Excellent.
So let's go and run npm run dev.
Actually, while that's doing that, let me make sure that
xdburg is installed on my environment. Yeah. Xdburg 3 point two. Okay. So this is my local
WordPress environment. So I basically just climbed out the code and done it this way,
which means I can turn dock off. It's not going to do that. It's third lock docker. Personal thing.
Then I should be able to enable things and get xdburg working.
All right. That's going to run. Okay. So that's watching. That's fine. So let's do this. This
should give me the installation, which is fine. I don't need the test data and all that kind of stuff.
No, no. It's wrong. My local database is WordPress root password. I don't care about
that because it's local only. Let's go. Let's go.
I'll just call it WordPress develop.
It's a local machine, so I don't care about passwords and all of that. All right.
So now let us configure xdburg. So I enable the debugger. That's working. And then in PHP storm.
Why is it not giving me that option? Oh, there we go. Weird. Local web server or shared folder.
So this is slightly incorrect. It's the source directory.
And the URL I can use is this one. And personally, this is why I like my local development
environment because I have a usable URL, which I quite like. So let's validate that.
Okay. Debug client unreachable. PHP storm enabled to reduce connections.
Server name. I wonder why this is not working. Let's see if we can get it to work.
So if I refresh this and I go to the home page and let us go to the index.php.
This is weird that it didn't. Oh, I think I know why this is. Okay. On second here, folks.
Let's cancel this. So I have these
PHP user INIs.
It sets up xdburg. And I've got a feeling we set this was.
Let's just have a look here. 8.127.
It's 8.1. So it's this one here. I've got a feeling this doesn't have the user INIs.
I'm going to need to copy this out. Stick it in my notes app. In case you're wondering,
I use simple note. But I've done it off screen because I store personal information in there as
well. Not really personal. It's just personal notes about my personal life. Like shopping and stuff.
So now I need to edit this person. Oh, it is there.
Okay. Let's see if it works. Okay. So let's go into PHP info here and let's just create a breakpoint.
And let's start listening for PHP debug connections. And let's refresh that page.
No, that didn't work. That's highly annoying.
This is another way you can do it. See what this does.
Let's go to client host is off.
Okay.
Okay. What I'm going to do, I'm going to switch this to PHP 7.4.
Because I know I've had stuff working on that version. Maybe I've got a weird wonkiness in my
in my default setup. So let's grab this. And let's get out of here and let's go
and pop it in here.
So this is going to switch it to using the PHP 7.4 FPM.
And let's do some Apache.
Okay. Let's running 7.4 now. So let's see what this does.
It's still unreachable.
Xzberg Remote Host and Xzberg Client Host are properly configured.
Frustrating. Okay. So now let's go and check out.
What's frustrating to me about this is that I've set this all up to work.
And the fact that it doesn't work tries me up the wall. So let's go to Xzberg.
No. There. Client Host. 192.168.641. Okay. Let's just do something here.
Has the host changed perhaps?
Okay. That one's 645.
Okay.
At least we're getting an error now.
Didn't get this last time.
Sometimes you've got to just turn it off and on again.
That's something else I was working on.
Oh, that's because, okay.
That's because the mount didn't work.
So let's fix that.
It should be a site directory.
So that hasn't worked.
So let's fix that.
Good grief.
I've been spending so much time convincing people they should use multi-pass for their
local development environments and now it fails me completely.
And I'm not happy about that.
Somewhere here there's a mount command.
There.
Oh, not that one.
Yeah, that one.
It's already mounted.
What?
Oh, good grief.
Maybe it's this.
Oh, that's fun.
I just broke my local development environment.
Good grief.
Okay.
This may end up being the most or the saddest livestream of day in a while because nothing's
working.
Okay.
So that's up and running again.
So.
Okay.
Yay.
It stops working again.
Okay.
Now let's try and see if we can get the validation script to run.
Oh, good grief.
Okay.
That's fine.
Okay.
That's working.
Let's try this.
Remote
Oh, good grief.
Now it's a whole bunch of other things.
I'm flummoxed, people.
Today was supposed to be a day where we tested this thing in Xdebug.
And that is not what's happening.
So I am going to have to go and do a little bit of research on how I can get Xdebug installed
for the WordPress developer development environment.
I am mildly annoyed.
There's another way you can -- it's a syscontroller.
This is a CTR patch to restart or something.
I want to try that one.
That's another way to do it.
Reload, restart.
Yeah, this one.
Okay.
Oh, this is annoying.
See, it picks up a PHPI file.
It's Xdebug 3.
But it doesn't -- it doesn't receive Xdebug connections.
That is so mildly annoying, I have to say.
It's on.
All right.
I'm giving up now.
This is terrible.
I'm going to go offline and do some research and see if we can get Xdebug working in this
environment.
Or I'm going to figure out why my local environment is not working.
Today is one of those days where, as a developer, I just want to give up.
And this is the, I guess, downside of doing live streams.
I don't plan for them.
I don't prepare for them.
I didn't test all of this stuff out before we got here.
I wanted you to see me get it working live and I didn't.
I still don't understand why my local environment isn't working.
It's like there's a port issue somewhere or something.
Wait, wait, wait, wait, wait, wait.
I just had a thought.
Just had a thought.
What port is Xdebug running on?
9003.
What happens?
I take out, I wonder if there's something on port 9003.
Yeah, red port 1003.
My host has only reached a bar.
In a way, PHP storm is running, which is what I've done.
It must be pingable from the server.
Which is what I've done.
Because that is, why is that sets a local host?
That should be, that's the problem.
That should be the address that I'm setting.
Xdebug client host.
That should be this.
Like this is not...
Okay.
I'm gonna go and check out what's in here.
Okay.
So I wonder if this is not being read.
So let's take this out and stick it inside here.
And then let's restart Apache.
All set to local host.
Something is not working properly here.
Let's say additional INI files post.
I wonder if I hard coded it into this one somewhere along the line.
And I've done this to myself.
I mean, it's insanely possible.
I'm gonna put it right at the bottom if I did.
No, it's not in there.
What happens if I do this?
I'm such an idiot.
I think I've just realized what I've done wrong.
And if it is that, I'm just wasted everybody's time.
So PHP 7.4 is running on the FPM, not Apache.
So what I need to be restarting Apache should restart it.
Maybe not PHP 7.4 FPM restart.
If this works, I'm going to be so annoyed.
Oh, good grief, folks.
Welcome to a developer losing his mind.
Let's go back to the user INI.
There it is.
Restart the FPM because that's what the site is running under.
Retry the validation.
Watch it work now.
Oh, it didn't work.
Last.
This should not give us...
Yeah, this gives us the right values.
Now, why didn't this work?
Hmm.
That's interesting.
Now it's all set up, but now it's not working.
How do I change that setting back to what it was?
I'm going to try the old turn off PHP storm and restart it.
Oh, this is...
That's why that didn't work.
I'm in the wrong folder, okay?
Let's try again.
Maybe not.
Yeah, so that is the right directory.
I honestly give up.
Now I've gotten this correct.
So this is working the way it should be.
Joy of choice.
Let's try and do an Apache service as well.
Sometimes that does it.
That is so nice.
It's creating the file.
Do you notice that?
If you have a look over here, it's creating, if you watch on the left here, it creates
a file for like a split second.
And it's going to do it now.
So let's watch.
It didn't create the file.
It must have been too quick.
I saw it create a file and then delete it.
Maybe I missed something.
Let's see what happens if we do this.
According to that, it all works.
This fails though.
Did it again.
I guess.
What is this?
What's this debug line that's on reachable?
Oh, good grief.
I can't believe I missed that.
That needs to be enabled.
Then you can do the web server debug validation.
Now, let's try this one.
Still not.
Start listening.
No.
I'm annoyed now.
Click start listening and nothing happens.
Like there's a problem with PHP debug or something.
Start listening to PHP debug connection should just start something,
but it doesn't seem to work.
There, now it's started.
That's weird.
Okay.
So now let's try the debug validation.
Now it's working.
Okay.
Working at least.
Let's test the Siri.
Now if we refresh this.
There we go.
Yay.
Good grief.
Okay.
Now let's try and get some debugging working in WordPress.
Let's go to index file and let's go down to line 23, for example.
It's listening for debug connections.
That's on.
Now if I refresh this.
Yes, this is what I want.
So I'm going to go to the settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings, settings
I get this from time to time where the path mappings don't work the way I expect them to.
Let's try that.
Yes, there we go.
I can debug my code.
Finally.
There we go.
So now we're here.
So let's step over.
It's not breaking though.
Maybe this is not the best way to break it.
Let's do that.
Let's do it.
Let's do it somewhere else.
Let's do it there.
Pathmappings, home, open to, hang on.
See path in the server.
Oh, is this.
Not.
Not part of the project.
That's wrong.
This should be.
This should be, sorry.
Should be WordPress.
Okay, there we go.
It's not stopping at my break point, but that's fine.
I can at least step over things.
Finally.
It's only taken me four ever to get here.
Folks, I'm just happy this is working.
Okay.
So let's delete that.
And then now we get to set all this up.
Which I'm going to do next week because I don't have energy to do it now.
Oh, dearie, dearie me.
Okay.
When I started these live streams, I didn't expect them to be easy.
They certainly aren't easy.
At least I know now why my things weren't working.
I don't understand why this button isn't working.
If I click stop now, it doesn't stop.
I have to click stop there.
So there's a bug here in this button.
It doesn't do a damn thing.
But there it works.
Okay.
So that needs to be started to be able to do the debug validation.
To be able to be happy about things.
I still don't quite understand why the INI settings are so out of work.
Because it was configured correctly.
So that's a weird one.
But anyway, I just want to clear out these INI files.
Okay.
So that's all fine.
So that's where I'm going to end off today.
We at least have a working WordPress install with the core code base in my local development environment running with XD bug.
So now I can dig into the bug and see what's going on.
Hopefully nobody fixes it between this week and next week.
That's where I'm going to end off today, folks.
Thank you for joining me.
Thank you for bearing with me while I try to get my local environment running and working.
I'm also going to do some research on how we can do this with WordPress develop.
Because it does bug me that it's not that simple.
I'm going to do some digging around and asking around and finding out if anybody knows how it's done.
And if I have time, I will try and get it set up before next week.
But at least now we have an environment where I can go and test this stuff out next week and see why this is not triggering something for the debug log.
So thank you.
I think it's Andrew for his yes in the chat there.
I appreciate that knowing that you are following me along in this journey.
I've got 20 minutes left of this hour and a half.
20 minutes is not enough time to start diving in.
So I'm going to take a break now.
And we will come back to this next week where I will at least have a working X debug environment.
And we can start actually testing these things and seeing what's going on and inspecting the code.
So yes, thank you all for joining me.
I hope you have a wonderful rest of your Wednesday.
Yes, speaking of which, the live streams are going to continue on Wednesdays for the foreseeable future.
Purely because my son has cricket matches on a Tuesday, which means I may or may not be available.
So we've switched to Wednesdays for now.
If that changes in the future, I'll try and let you know while in advance.
But this will be us or at least me every Wednesday trying to fix my broken things and trying to remember how it all works.
All right.
Thanks, folks.
Have a great rest of your Wednesday and I'll see you next week.
Bye.
[BLANK_AUDIO]