title: Can Visual Studio be set up to remote debug a php based site housed on virtualbox?
body: <p><strong>My setup:</strong>
  One machine running Visual Studio 2013 pro and Oracle Virtualbox: Mint 17, Apache 2, PHP5, Mysql.
  I've network mapped my home directory, using samba. The project is located off of my home directory, in a public_html folder. This set-up was requested because we develop in windows environment but the site is hosted on a ubuntu server.  </p>
  
  <p><strong>The Site:</strong>
  It is a PHP website using the codeigniter framework that, amongst other things, passes a generated page into PhantomJS to create a screen shot of the page to pass into a site generated pdf file as a report for the user.</p>
  
  <p><strong>The problem:</strong>
  I can run the site as is on the Mint vbox both from /var/www and from {ip}/~userDir just fine. However some issues plague me that I would like to be able to use PHP tools for Visual Studio's (Devsense) ability to breakpoint the php itself and read the current state of objects. When I try to use VS (the iis express server that comes with VS I think) I can step into the code at my break point and easily view the state of my objects. However the only thing that refuses to work is the PhantomJS (though the VS IIS Only). Running the same process on the LAMP works just fine. (I.E)</p>
  
  <pre><code>$src = "var page = require('webpage').create(); page.viewportSize = { width: {$wi} , height: {$hi}};";
    if (isset($clipw) &amp;&amp; isset($cliph)) {
        $src .= "page.clipRect = { top: 0, left: 0, width: {$clipw}, height: {$cliph} };";
    }
  $src .= "page.open('{$url}', function () {
           page.evaluate(function() {
                 document.body.bgColor = 'white';
                 });
  
           page.render('{$cache_job}');
                 phantom.exit();
                });
           page.onError = function (msg, trace) {
               console.log(msg);
               trace.forEach(function(item) {
               console.log('  ', item.file, ':', item.line);
                })
           }";
  $job_file = $jobs . $url_segs['host'] . crc32($src) . '.js';
  file_put_contents($job_file, $src);
  $exec = $bin_files . 'phantomjs ' . $job_file;
  $escaped_command = escapeshellcmd($exec);
  $output = exec($escaped_command, $outArray, $rtnVal );
  $someError = error_get_last();
  </code></pre>
  
  <p>I 'assume' the roadblock is somewhere between the iis setup (which I'm not proficient in at all) and how i'm using a linux share from windows. The     <code>escapeshellcmd($exec)</code> command I'm using just before I pass into <code>exec()</code> renders the path differently in VS then it does on the LAMP server. I get no response (read as: stepping in and reading the states of each var after the line is executed) back at all from <code>$output = exec($escaped_command, $outArray, $rtnVal )</code> or even <code>$someError = error_get_last()</code>.</p>
  
  <p><strong>The Question:</strong>
  Has anyone set up VS to use a virtual Linux server for testing php using breakponts? Can I set VS up so it uses the php engine from the LAMP instead of its own?</p>
  
  <p>I know in the project options tab in the Servers area you can 'Use Custom Web Server', yet when I put the IP of the Virtualbox in that spot I get "Invalid URI: The hostname could not be parsed." I know the server is there, the welcome page comes up when I put the same URL into the browser. </p>
  
  <p>Thank you for taking the time to read this and any help you might have.</p>