PHP Linter when using Vagrant


#1

Hi,

I installed Linter package and then PHP-Linter. The problem is that Atom is requiring PHP executable path for providing syntax errors. I am using Vagrant for my development and all of my web development softwares are installed inside my VM.

Is there any way that i can use PHP Linter without installing PHP on my local machine as there is no point of using VIrtual Machine if i have to installed PHP on my host machine.

Thanks


#2

I will look into this. I believe you should be able to.


#3

In the background linter-php is simply running php -l on the current contents of the editor window, as such it needs to have the php command accessible on the platform you are running on.

To run in the manner you are talking about an entire remote debugging framework would need to be written to send the contents off to the VM, execute php -l there, send the contents back, and finally display them to you. Although it is technically possible, it is far beyond what should be necessary as you can simply install PHP on your computer.


#4

I understand your point. But one purpose of using VM is that to keep host machine clean and shift all the development stuff to VM. If our folder can be synced, database connection can be synced. Then i think it will be good to keep editor synced in some way.

So is there any plan in Atom development for this support ?


#5

I have no plans to implement this in linter-php, which is where it would need to be done.

What you are asking is a very large and complex task with a lot of places that it could break. It isn’t worth the time or effort when the solution is to just install php on your development machine.

If you are trying to keep the host machine “clean” then you should keep the rest of your development tools installed on it as well, such as Atom, in which case php would be accessible and this wouldn’t be an issue.

That all being said, it’s possible in the future something like this might be possible when https://github.com/atom/atom/issues/9841 is dealt with and somebody writes a remote PHP debugging plugin.


#6

Couldn’t you simply change the php path location (in the settings of php-linter) and link it to a script? This script would then run the php command on your VM. Of course you still have to create the script and store it on your machine.
Greetings