Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:04:41+00:00 2026-06-14T23:04:41+00:00

I am using sublime text 2, and I wanted to use the plugin sublimelinter.

  • 0

I am using sublime text 2, and I wanted to use the plugin sublimelinter. It checks the code in the background with php -l. I’m developing with a webserver running in a VirtualBox VM, webserver is in the VM (guest) and sublime text is running on the host.

Any way to get those 2 working together? I really wanted to avoid installing php outside the VM.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:04:42+00:00Added an answer on June 14, 2026 at 11:04 pm

    I’ve got something that works reasonably well on my machine, but it seems fragile.

    The Idea

    The idea here is to create a command-line script on your host that passes all its parameters to a PHP call on your VM, via an SSH tunnel. SublimeLinter can then call this script as it would usually call the PHP binary, and from Sublime’s point of view everything will “just work” without having to install PHP on your host.

    I’m using both Windows and OS X hosts so I’ve got two versions of my tunnel script. Note that on Windows you’ll need to fetch the Windows PuTTY SSH tools, but for Unix-flavored hosts SSH will likely already be present.

    For Windows Hosts

    • Download the putty tools and unzip them somewhere useful like C:/Users/Youruser/bin/putty.
    • Create the batch script at C:/Users/Youruser/bin/php_vm_tunnel.bat with this content:
    @echo off
    C:/Users/Youruser/bin/putty/plink -l youruser -pw yourpassword 192.168.56.101 php %*
    

    NOTE – be sure and replace the path to plink with the correct path where you unzipped putty above. Also, replace the -l and -pw flag values with the username and password that you use when you SSH into your VM. Finally, be sure and replace the IP address in the example with the IP address you use to SSH into your VM.

    For Unix-ish Hosts (OS X, Linux, etc)

    • Create the bash script at ~\bin\php_vm_tunnel
    #!/usr/bin/env bash
    FIXED_ARGS='';
    for (( i = 1; i <= $# ; i++ )); do
        eval ARG=\$$i
        FIXED_ARGS="$FIXED_ARGS $(echo "$ARG" | awk '{gsub(".", "\\&");print}')"
    done
    ssh -l root 192.168.56.101 php $FIXED_ARGS
    

    NOTE – be sure to replace the -l flag value with the username that you use when you SSH into your VM. Also, be sure to replace the IP address in the example with the IP address you use to SSH into your VM.

    Testing the Script

    At this point you have a script that should tunnel anything you pass to it through to your VM. So if in a terminal you were to do, say:

    cd wherever_you_put_the_script 
    php_vm_tunnel -v
    

    You should see the PHP version info return from your virtual machine.

    Sublime Text 2 Configuration

    Now that you have this tunnel set up, you can configure Sublime Text 2 to make use of it:

    • Install the Package Control Sublime Text 2 plugin
    • Install the SublimeLinter plugin (it sounds like you were already at this point)
    • Go to Preferences -> Package Settings -> SublimeLinter -> Settings - User
    • Add this to the configuration file (again substituting in the proper path to the script and noting the double slashes to properly escape the backslash characters) and save:

      {
          "sublimelinter_executable_map":
          {
              "php": "C:\\\Users\\\Youruser\\\bin\\\php_vm_tunnel.bat"
              "php": "/Users/youruser/bin/php_vm_tunnel"
          }
      }
      

      NOTE – You can only have one “php” statement. The first one above is the Windows version, the second one is the Unix version. Delete the one you don’t need.

    • restart Sublime Text

    If you open the Sublime Text console (and everything went according to plan) you should see something in the startup text like like:

    SublimeLinter: php enabled (using "C:\Users\Youruser\bin\php_vm_tunnel.bat" for executable)
    

    And SublimeLinter should be properly linting PHP files as if it were calling a native PHP binary.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Sublime Text 2 and SublimeCodeIntel plugin. I want to have some code
How can I automatically check errors in my code when I'm using Sublime Text
Using my text editor of choice, Sublime 2, I want to search through code
I think many of you are using or used to use Sublime Text 2
I've been using Sublime text 2 for the past few days, and I have
I've started using Sublime Text and it's great. But while editing Wix setup files
I've been watching some Railscast episodes and it looks like he's using Sublime Text
The guys I'm working with use Eclipse as their IDE and I'm using Sublime.
I'm using Sublime Text to edit a batch file on Windows. I'd like to
Using Sublime Text 2, I sometimes have to edit shell files that are executed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.