2020-01-24 09:20:48

Hello guys, ceriously need advice on keeping going or throwing my career as a developer,
I came to a point where I need to decide how to move on my development. My 2 choices are:
1. Continue on PHP projects;
2. Learn C# further and then get on some projects.
If I am to keep goint with PHP, i plan to work in the company as a part time job, but whatever, they use Linux everywhere and especially insist on using PHPStorm, which wasn't accessible few years ago so I used Eclipse as my current IDE for that case, but now situation is much better for Windows environment at least. Now it's accessible if we enable JABSwitch and set some conf in idea.properties file. It's one of the most popular IDEs and has Intellisence, Auto-indent, tidy, quick jumps between parts of the code, no lag, lets to easily set up Composer, frameworks, documenting / commenting code parts and so forth. Since it's accessible only on Windows environment, I thaught it will be fine, but they all use Linux environment and that means sometimes I could face issues because of inconsistancies between libraries, even such simple differences like capitalisation in namespaces/files might break down the code at some parts, also server configuration, types (Nginks, Apache or whatever) might bring headacke on mod_rewrite or php.ini. So I just want to be sure that system in which I write my code would be the same as in the server on which it will be published as a production. Since I almost have no knowledge on Linux Bash, I decided not to install it on my PC, rather instead installed WSL and chose Ubuntu OS to try it out. Well it has it's limitations. Yeah, I can admit it works fast, but when I install LAMP, I noticed all the services aren't envoked automatically after turning on that CLI / console again. What I mean to say is that WAMP doesnt' start automatically on WSL. After Googling a bit I found out there is a way around this by using schedule tasks on Windows Commant Prompt and stick with it, but if I would close that Bash window, it would require to invoke all the services by hand again or reboot my Win environment to use that scheduler, or write some file to do it for me, whatever. I just started to do this as I mentioned and now wonder if is this all right or not. I will need to use GIT, perhaps Docker at some time (which I almost know nothing about). GIT is fine, because interface goes through some sort of CLI and not the GUI so I'm safe at least with repositories.
Other way around this might we just a regular installation of the Ubuntu or some other distro, though I should use Emacs or whatever do blind devs use on it and I really need these indentation, documenting and other features that I mentioned and it doesn't have it right? Perhaps Eclipse is accessible with Orca on Ubuntu? Or perhaps even PHPStorm is accessible in their with Orca? I mean how is this screen reader, worth to wach for or not?
I know it's possible to use SSH with Putty to connect to the server and do stuff, also I can throw my code directly to the remote server via FTP, but I really need a decent local environment to get the work done. Or am I overthinking this? Perhaps it's possible somehow to insure that there wouldn't be any differences between configurations on LAMP and WAMP at all (that I guess less likely)?
Never worked with virtual machines, maybe all the problems that I just want to test and debug my code on Linux and write it on Windows in order to get the best experience lies in this secret? Can I configure both systems together that it would work as I mentioned?
I don't really want to abanden PHP, because it got me where I am today and I really need to earn money, have a great knowledge of MySQL, JS, JQuery, AJAX, XML, JSON and really woudn't want to waste these skills, but looks like technology calls the shots here.
Other way is to go on Visual studio, because it's customisable, screen reader friendly, a bit laggy but can use to that. OK, that's enough, please say something useful...

2020-01-24 10:03:58

Well, learn Linux! Everything that works on PHP (allmost everything) works on Linux. I know no good PHP IDE, although PHP Storm might be accessible (might, but doesn't have to). I am happy to help with any Linux questions you might ever have.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2020-01-24 10:16:24

Yeah, I I guess should learn Linux then, but that doesn't solve a problem for me to write a code with a proper IDE. Perhaps you have some suggestions how to start on that Linux environment? is it better to have Virtual Machine, or a real environment?

2020-01-24 11:24:53

It's always better thing to have a real OS, VM shelves some stuff from you, and if you don't want to be disappointed, don't tsarrt with Ubuntu.
If you need further help write here:
nuno69a at gmail dot com.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2020-01-25 03:29:53 (edited by nyanchan 2020-01-25 03:34:10)

You can edit your code on remote using Visual Studio Code. Here's what I do in the company I'm working at:
1) Run an Ubuntu VM on Windows10. I'm using vagrant + virtualbox.
2) On the VM, do basic ssh configuration so that I can ssh into it using my own private key.
3) Run vscode on Windows and set up remote ssh feature so that I can connect to the VM I just created.
4) Write some code.
5) Use teraterm as our shell, connect it to the VM and run commands as usual.
I have never faced limitations in this method; apt-get works, gcc compiles, networking works (need to configure in vagrantfile though), Ruby on Rails works, just like the real Ubuntu machine. Also, the same approach can be used for AWS remote instances, so we can do lots of things.
Either way, you need to learn unix-based system.

I don't speak as good as I write, and I don't listen as good as I speak.

2020-01-25 05:28:37

I use WSL and a text editor EdSharp. I'm able to run servers, pull code, run CMake builds, ssh, and do just about everything. I use Node and python, so not PhP, so there may be some differences. I also use ODrive or Git to pull files into my windows machine. Since you can visit your Windows machine from WSL, I just run everything from Linux and type in my Windows text editor.
Creating bash scripts is not hard. Node has the ability to run scripts when you start the server, I'm sure PHP has the same ability.

2020-01-25 06:13:17

I'm happy using vsCode or vs 2019 (when is necessary) and for compile stuff or something similar, I use wsl with ubuntu.

For server things I run a local copy of XAMPP when I need them, or simply run a docker image of apache, njinx or something that you need, and well works very fine for me.

And In my case, I love use windows, so My perfect combo is windows + wsl.

2020-01-25 07:07:27

I use Linux pretty much full time now. I use no IDE (I find IDEs to not be helpful when I want to just churn out code). My editor is Pluma for the desktop and Nano for the CLI. When in the Desktop, I always have (1) a terminal window open with at least 2 tabs set up, one for debugging and one for compilation; (2) my editor; and (3) my web browser to read online documentation. When in the CLI I use either separate TTYs or separate windows in (say) tmux.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-01-25 10:13:10

Interesting stuff you all mentioned here. Do WSL does almost everything that developer would might need? For instance I would need to configure some conf file on Linux, what sould I do then? Because WSL has no ability to use Orca or something.

2020-01-25 12:12:25

lurn bowth php and c#

2020-01-25 20:46:22

@9, no, WSL can't do everything you could need... for example, yes, you can build most programs, but if you want to use low-levl Linux APIs or POSIX functions that MS hasn't implemented yet, it won't work properly if it all.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-01-26 08:39:00

So I share my experience:
Installed WSL on my Win10 PRO and started to explore. Everything seems to work well, but I don't get how would you scroll through that command line?

2020-01-26 13:43:23

I decided to try out the Vagrant with VirtualBox as well. Installed Vagrant, VirtualBox, then when I finally managed to do it all right, I got this after entering vagrant up:

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/bionic64' version '1.0.282' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key

After a wile, this message pops up:
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Ideas how to solve it?

2020-01-26 16:24:15 (edited by nyanchan 2020-01-26 16:24:31)

It might be related to the box you're using. Maybe, try using ubuntu-trusty64 or ubuntu-bionic64? They're what I've successfully run so far.

I don't speak as good as I write, and I don't listen as good as I speak.

2020-01-26 19:20:58

I'm not precisely sure what causes this problem. I was suffering this with every Vagrant box I tried on Windows and I don't suffer that any more.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-01-26 21:08:47

I don't understand that either. Installing another box system doesn't help as well. I checked my BIOS, virtualisations is enabled, tryed to give that Vagrant more time to initiate that system through VirtualBox and nothing good came out of it. Although before installing Vagrant, I had problem because of some dll so I just applyed all the privileges to temp on appdata and finally it started the setup successfully. I checked my Vagrant and it was for x86 architecture so I installed a new one as x64 and still nothing. Few problems with VirtualBox came as well, but I just downloaded an older version (v6.0 to be specific) and then Vagrant finally detected it, though I wasn't able to start my Linux as you can see on error above. Not sure what else to do... Perhaps reinstall system (installed year ago) though updates coming regulary.

2020-01-27 01:53:36

@16 Is HyperV enabled on your system? Haven't used Windows in years, but when I did, HyperV had to be disabled to use VirtualBox. It would sometimes re-enable itself, which IIRC caused my VMs to not boot.

This may have been resolved since, or maybe there's some way to configure Vagrant to not use VBox and to instead use HyperV. You'd have to google to find how to disable it, though I think it was in the area to enable/disable Windows features. It also may or may not block use of WSL, so you may want to investigate your options.

2020-01-27 04:37:47

It doesn't interfeer with WSL and I turned it off via Windows Features, still the same.

2020-01-27 08:10:53

Go into run and type msinfo32.exe and press enter. Does it indicate that "a hypervisor has been detected"?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-01-27 08:15:30

Nope, it is off. I turned it off via Windows features.

2020-01-27 09:14:52

Oh sorry, hypervisor has been detected

2020-01-27 15:48:59

I finally did it. The problem was that Hyper-v didn't completely disable even when I uninstalled in through Windows features. I guess if I would disable Secure boot on my BIOS and reboot Windows, then enable SecureBoot and boot windows it would of worked, however I'm blind and BIOS isn't friendly. That's what I did:
I issued command on PowerShell "bcdedit /set hypervisorlaunchtype off" and it finished that virtualization and by checking on msinfo32.exe there is no longer Virtualization enabled anymore.
Now I can easily boot my VMS and SSH into it.
Next question is how to quickly set it up to work with my IDE, I mean that I could be able to make a shared folder and cope with that, or should I generate an SSH private and public keys and set up an environment somehow?
@5 said: "On the VM, do basic ssh configuration so that I can ssh into it using my own private key". That is what is this basic configuration? I generated the both public and private ssh keys, what's next? It doesn't matter which IDE you're using, I just need to get it right. I can set up SSH sharing and by doing so, connect from my host system and send the code to the VMS? I mean set that ssh sharing via vagrant share -ssh? Or that's enough to just make sync folder? By the way I like that vagrant style
Now I'm thinking about the editing. If I for instance wish to modify apache.conf file, what should I do - turn on GUI version (desktop) and use orca to edit with some text editor or what?

2020-01-27 16:19:34

@22 Glad it worked! For future reference, there does appear to be a HyperV Vagrant provider, but you need to configure it as the default. So if you ever need HyperV and Vagrant, that's what you'll need to do.

As far as folder sharing, I think most (all?) Vagrant boxes share the directory containing the Vagrantfile as /vagrant in the guest. So add a Vagrantfile to your project, "vagrant up", "vagrant ssh", and configure things in the VM to use your project at /vagrant. If working with PHP, configure Apache/Nginx/whatever as if your project was at /vagrant for example. Then just edit the files in your IDE of choice. You'll probably also need to set up a port forward to the VM.

2020-01-27 18:29:22

@23, yeah, thanks. Though 1 thing is still unclear to me, how can I edit files that are in my Linux machine? I mean some configuration files that they're not synced? Some configurations or whatever? Or I should bring up desktop environment?

2020-01-27 19:35:23

@24, just use something like Nano for that.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github