Configuring PHPStorm to run PHPUnit Tests with Homestead

I use PHPStorm to run my local server with the Homestead virtual machine on Vagrant. In the past all my testing was command line but I thought, “Wouldn’t it be great to use PHPStorm’s testing features?” So, after much Googling and failing here’s a video on how to run tests on a remove server, even Homestead, using PHPStorm’s tools.

The steps:

  • Configure Server in “Deployment” settings
  • Setup your project’s CLI Interpreter to use this Server
  • Setup PHPUnit in PHPStorm to run tests through the CLI configuration and use your phpunit.xml file for config.

Forge: How to cd into /var/log/nginx when permission is denied by the default user

I have a server on DigitalOcean setup by Forge to host a Laravel power project. Things are good then the site goes down. Hmm, let’s check the logs. Logs are located at /var/log/nginx for access and error but… I can’t cd into nginx. 🙁 Big. ol. Frown. Face.

The platform re-emerged and I vowed to return to the issue again. I did, after the thing went down again. Still no cd’ing into nginx. Not even a sudo cd which, after reading an article, is a nonsensical command.

So here’s the solution.

sudo su cd /var/log/nginx

sudo su allows you to run all commands as root. Something I didn’t know how to do with Forge as you get a sudo password but not a root user. Now that we are root we can cd into nginx. All is good.

IMPORTANT!!! Don’t run a command as root unless you have to. sudo su back to your user account (ex: sudo su forge) before going back to hacking your way through ubuntu jungle.