How to run PHP code using Sublime Text and direct output to the browser instead of the console

StackOverflow https://stackoverflow.com/questions/23122048

  •  05-07-2023
  •  | 
  •  

Question

I'm interested in switching to Sublime Text2 from Netbeans 8 for PHP development. (It's making mincemeat out of my 2008 MBP!) I've have figured out how to run PHP code using the Build System, which displays output in the ST2 console, from this blog post. I'd like to display the output in my default browser instead of the console, just like the grownup IDE's do.

I plan to try XDEBUG next with this blog post, but think getting this running first is a good place to start.

My code is

<?php
    phpInfo();

Thanks in advance!

Was it helpful?

Solution

You can install the Sublime Text plugin BrowserRefresh-Sublime. From the README:

After installing this plugin you can hit command+shift+r on Mac OS X or ctrl+shift+r on Windows and Linux while using your favorite browser, the last active window will come to the foreground (you can turn this off in Chrome, Canary, Safari, WebKit and Yandex on Mac) and reload the active tab. If the current file is unsaved, it will be saved before the browser is activated and reloaded.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top