Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Rob Allen: Using Phing to SSH into a Vagrant box

Rob Allen: Using Phing to SSH into a Vagrant box

In a quick new post to his site Rob Allen shows you how to have Phing SSH into a Vagrant box as a part of the VM creation process. In his case, he uses it to run database migrations.

Now that I’ve started using migrations, I’ve discovered a minor irritant. I run this project on a Vagrant VM and have discovered that I keep forgetting to ssh into the vagrant box before running the migrations script. The obvious solution is to automate this and I decided to use Phing to do so.

He walks through the installation of the libssh2 software (if you don’t already have it) and the ssh2 PHP extension</a. With those in place, he shows how to use the SshTask to make the connection as the “vagrant” user and execute the given PHP command.

Link: http://akrabat.com/php/using-phing-to-ssh-into-a-vagrant-box/
Source: http://www.phpdeveloper.org/news/22015

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Posted Listopad 26th, 2014 in WEB and PHP Development.

Leave a response: