Return to Level1Techs.com

Visual studios code (php help)

Hi, I’ve recently been getting into some web development with php. I’m currently using Xampp on my windows desktop to run a test server and a basic text editor to code in. However, I would like to start development on a project that is stored on a local server that I can code from. I’m currently running an unraid server with visual studios code installed as a docker that is accessible through the web gui. I was wondering how I can use this to run my php code or if there is a better way? Also I was wondering if there are any good tutorials for doing this?

Well I honestly don’t understand the question. But let me try to answer it anyway :).

I personally wouldn’t use visual studio code if a project is making me money and I’m not just fiddling around, but it’s personal preference coming from more than a decade of using JetBrains’ products.

Second when I have WSL on windows 10 I wouldn’t be using XAMPP but the standard lamp stack instead.

Third I wouldn’t be coding on a remote server directly. So I’d start with setting up a local project I can test during development, git and CI/CD via Jenkings for example, a pretty good talk on the matter of CI/CD would be https://www.youtube.com/watch?v=kuBD3p20oyE for example.

1 Like

VSCode has ssh feature. Search for it and then on the bottom left there is a little </> icon and then you type in the IP of what you want to say to. If you have set up with proper ssh keys you won’t have to type the password in every time.

2 Likes

clarification

I am new to php and have been working on learning how it works. I used to do some coding with java a while back but its been a little while since I’ve been coding. I don’t have a ton of money to spend so I try to avoid programs that require subscriptions in favor of one time purchases or even better free ones. Hence why I’ve been messing around with visual studios code.

currently the visual studios code is running in a docker container so that in theory I can code from my desktop or laptop and not have to worry about version control. However, I have used git hub in the past so I may end up using that instead.

I have heard of Jenkins but I don’t quite understand what it does. Is it mainly for doing version control and deploying your code to a live server?

also the Lamp stack seems like a better solution but I’m not sure how I would begin to deploy something like that?

Okay, so currently you have a server running on your desktop, for now, while to test stuff

This bit is a red confusing, Not sure if I’m reading this right, but I think you mean, you have an Unraid machine in your house, and a docker running VSCode? or by local server, do you still mean the desktop?

So you would like to use the Unraid box to host a project?

Just trying to look at the basic set up here.

I have no idea about running PHP or anything on the docker, but I don’t see why not

1 Like

windows is running as a virtual machine in unraid I had a test server running in the virtual machine but i am trying to find a way to work in the visual studios code docker container.

1 Like

+1 I’m getting mixed vibes here.

Is there a reason you’re not running VS Code on the machine you’re using normally, build a container, for example this: https://phpdocker.io/generator would be a decent starting point, develop your app locally and just deploy the entire thing when you’re done (since you’re obviously not going to use version control).

I started using VScode because it was free and there was a prebuilt container for it but this php docker generator seems like it could be helpful for what I want to do thanks for the help.