 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 I 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. 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 XD bug 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 XD bug flag. And with that flag enabled, you can then configure your IDE to listen for XD bug 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. So 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 Descript 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 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. This could take a while, apparently. I also, I minimized 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. Okay. So that all worked. NPM run pull dev. So it's 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, yeah, include the XT bug switch. It's going to be that one there. NPM run WPNV starts. NPM run ENV start. Okay. I guess WPNV start might work as well. Theoretically it should work. So let's try that. Oh, okay. It doesn't work. So maybe if I just go in the ENV start with the XP debug switch. Let's try that. NPM run ENV start. Let's see if that works. Okay. I have no idea if that's working. I 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 XT bug switch and see if that works. No, same error. Try the failure programming, similar connectivity at endpoint blah. 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 check all that, commanders. Yarn run ENV stop and then yarn run. 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. 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 XT bug 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. I think this works. Oh, did I do this at some point in the past? Must have done. Okay. Well, let's try it. Let's go validate. Specified URL is not reasonable, caused by request for all status code. Interesting. What did I have in here? 1-2-7-0-0-1. Yeah, that's going to work. Let's see what happens. I don't know why PHP storm can't access that URL. Okay. Let's do some Googling. I wonder if there's something in the readme, which is the readme. Okay. Let's see what Google tells us. So press develop XT bug PHP storm. There's probably nothing called 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, wait. I need to pass the source. That might be why. The code is actually sitting in the source directory. No. Oh, something happened. Hey. Okay. Hmm. So the client host is unreachable. So no PHP, INI 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 an 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 it's fine. Okay. And theoretically, I should be able to go. Yes. Yay. That works. Okay. So let's do an XT bug. Hmm. Local PHP. So it looks like XT bug might not be enabled. So we're at press develop. Hmm. 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 in here about XT bug? Probably not. Which one are we running? NPM run ENV start. ENV start runs local ENV script start. Locals or tools. Tools. Local ENV. There's a PHP config INI. I wonder if I can change those. The question is, is XT bug even installed? See. Hmm. It looks like WordPress develop is not using WP ENV. It's just using a custom Docker environment. So that means I need to install XT bug on the Docker environment. First. Okay. Looks like we don't have XT bug 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. Do it on my local which has XT bug 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 to get clone WordPress develop into here. That's going to set up this project. Open this. So this is my local 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. That's done. And then I need to... That's the name of the instance on my local environment. So I need to point this to the source directory. This is very specific to my local chosen environment. Whatever you're using you might have to do something different. 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. 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. 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.0 something. Which I might need to change. So let's do that. Let's go... I'll just PHP info. So folks if you ever create a PHP info file on the server. Make sure it's deleted afterwards. Okay. It's running 8.1. So that should be okay. We can always switch it to 7.4 or something if we need to. All right. Okay. That's all run. Excellent. So let's go and run NPM rendev. Actually while that's doing that. Let me make sure that XD bug is installed on my environment. Yeah. XD bug 3.2. 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 duck off. So I'm going to do that. It's not like duck. There's nothing. And then I should be able to enable things and get XD bug 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. Just fine. I don't need the test dates and all that kind of stuff. It's wrong. My local databases 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 debugger. 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 unable to reduce connections. Server name. Wonder why this is not working. Let's see if we can get it to work. So if I refresh to this and I go to. Let's go to the homepage. And let us go to the index of PHP. This, this is weird that it didn't. Oh, I think I know why this is. Okay. I'm second here, folks. Let's cancel this. So I have these PHP user iron eyes. It sets up. X debug. And I've got a feeling we said this was just like, yeah, one, two, seven. So it went one. So it's this one here. I've got a feeling this doesn't have the user iron eyes. I'm going to need to, we need to copy this out. Stick it in my notes up. In case you're wondering, I use simple notes, but I've done it off screen because I store personal information in there as well. Not really personal. It's just like personal notes about my personal life. Like shopping and stuff. In case you're wondering. Okay. So now I need to edit this person. Oh, it is there. Okay. Let's see if it works. 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 reverse that page. No, it didn't work. That's highly annoying. This is another way you can do it. See what this does. Whether client host is off. 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 default setup. So let's grab this. Get out of here. And let's go in here. So this is going to switch it to using the PHP 7.4 FPM. Let's switch on the patchy. It's running 7.4 now. So let's see what this does. It's still unreachable. XTBug remote host and XTBug 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 drives me up the wall. So let's go to XTBug. Yeah. There. Client host 192.1686.41. Okay. Let's just do something here. That's the host change, perhaps. 1645. My local environment is failing me. It's kind of annoying. Client host 192.1686.41. It honestly should just be working. I wonder if the client host IP has changed somehow. When one of your own blog posts comes up. This is annoying. I'm honestly annoyed now. I've got another WordPress site set up here. I want to see what happens if I do this one. Oh, man. Let's try XTBug discover client host. See if that'll fix it. This is basically becoming a me trying to troubleshoot my local development environment session. Because I couldn't get XTBug to work in the WordPress developed local environment. And it sucks. If I'm honest. Let's try that. See what happens. I just turned it on. UTC PHP 7.4. UTC PHP 7.4. Oh, wait, wait, wait, wait. Oh, PHP 7.4. Yeah, that's right. I just turned it on. Why are you not working? It's like it's not reading from that. Can I file something? I'm going to restart this thing. I'm really annoyed today, folks. And you can't even listen to the cool music in the background today. Because I couldn't get that to work. I'm embarrassing. OK. The following error has occurred. Oh, goodie. It's running. So let's see if anything's changed. Special. Good grief. OK. At least we're getting an error now. Didn't get this last time. Sometimes you got to just turn it off and on again. That's something else I was working on. Oh, that's because, OK. That's because the mount didn't work. So let's fix that. There should be a sites directory here. So that hasn't worked. So let's fix that. Good grief. I'm getting so much time convincing people they should use multi-pass for their local development environments and now it fails me completely. I'm not happy about that. Somewhere here there's a mount command. Yeah, that one. It's already mounted. What? Good grief. Maybe it's this... Well, that's fun. I just broke my local development environment. Good grief. Good grief. OK. This may end up being the most... or the saddest life story I've done in a while. Because nothing's working. OK. So that's up and running again. So... Yay. It stops working again. OK. Now let's try and see if we can get the validation script to run. Oh, good grief. OK. That's fine. OK. That's working. That's working. Let's try this. Remotes who can figure as localize this by server... 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 XDbug. 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 XDbug installed for the WordPress develop local development environment. I am mildly annoyed. There's another way you can... It's this controller. This is CTR to restart or something. I'm going to try that one. There's like another way to do it. Reload, restart. Oh, this is annoying. See, it picks up the PAPI file. It's XDbug3... but it doesn't... it doesn't... receive XDbug connections. It's so mildly annoying, I have to say. The debug is on. All right. I'm giving up now. This is terrible. I'm going to go offline and I'm going to do some research and see if we can get XDbug working in this environment. Or I'm going to figure out why my local environment is not working. One of those days 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. I wonder... Wait, wait, wait, wait, wait, wait. I just had a thought. Just had a thought. Port is XDbug running on. 2003. What happens? I take out... I wonder if there's something on port 9003. 9003. I had to host an unreachable... 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 set to local host? That should be... That's the problem. That should be the address that I'm setting. XDbug client host. That should be this. Like this is not... I'm going to go and check out what's in here. Okay. So I wonder if this is not being read. So let's take this out. Stick it inside... here. And then let's restart Apache. It still sets a local host. Something is not working properly here. Let's say additional INIFilesPost. I wonder if I hard coded into this one somewhere along the line. And I've done this to myself. I mean that's insanely possible. I'm going to put it right at the bottom if I did. What happens if I do this? I'm such an idiot. I'm such an idiot. I think I've just realized what I've done wrong. And if it is... If it is that... I'm just wasting every waste time. So PHP 7.4 is running... is running on the FPM. It's 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. Good grief, folks. Welcome to a developer losing his mind. So let's go back to the user Ili. There it is. Restart the FPM because that's what the site is running under. Retry the validation. Retry the validation. Watch it work now. Oh. It didn't work. Blast. But... This should now give us... Yeah, this gives us the right values. Now why didn't this work? Now it's all set up, but now it's not working. If 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. 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. 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. 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. What says debug client hose unreachable? Great grief. I can't believe I missed that. That needs to be enabled. Then you can do the web server debug validation. No. Let's try this one. Still not. Start listening. I'm annoyed now. Let's start listening and nothing happens. There's a problem with PHP debug or something. PHP storm. 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. Got it working at least. So let's test the series. So now if we refresh this. There we go. Yay. Good grief. Okay. So now let us try and get some debugging working in WordPress. Let's go to index file and let's go down to I don't know. Line 23 for example. And it's listening for debug connections. And that's on. So now if I refresh this. Yes. This is what I want. So now we start with the import mappings. Basically we choose WordPress source index. Should be that one. Yes. But now the debug is not coming up. Good grief. I get this from time to time where the path mappings don't work the way I expect them to. So try that. Yes. There we go. I can debug my code. Finally. Okay. 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. Mapping is home. Oh, hang on. Is it path on the server? Oh, is this? Okay. That's wrong. This should be WordPress. Okay. There we go. It's not stopping at my breakpoint, but that's fine. I can at least step over things. Finally. It's only taking me forever to get you. 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 were started back 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 bag 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 developer because it does bag me that it's not that simple. I'm going to do some digging around and some 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 on 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 XT bug 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 will be 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.