vagrant + xdebug + svn AND git + PHPUnit


how do I set up this complicated enviroment in phpStorm?

We have  a vagrant, in dir, say, ~/vagrantbox, it forwards port 8080 to 80

in ~/vagrantbox/app we have our app, that has 4 dirs:

2 of them (one is called 'current', other has libraries) is tracked in svn,

one with libraries in other svn,

one with other libraries in git

there are 3 "services" on that vagrant server:

http://frontend.mycompany.local:8080 corresponds to  ~/vagrantbox/app/current/frontend/www

http://backend.mycompany.local:8080 corresponds to  ~/vagrantbox/app/current/web/admin

http://service.mycompany.local:8080/api/someStuff corresponds to  ~/vagrantbox/app/current/service/my/a/someStuff

(all those domains points to my localhost)

On the vagrant VM we have php with xdebug, that I was luckily able to connect to and debug.
We plan to use PHPUnit too.

- how do I create project from exisitng files - choose local files and local machine, or remote?
- How do I set up folders and their associations to web server on vagrant so I can run or debug code on vagrant form PHPStorm?
- How do I set up CVS in PHPStorm with those 3 repositories?

Comment actions Permalink

So far I got it running, also with  xdebug, by making  new project  from files - local files and local server.
But I am still undure which deployment mode should I use - sftp, local folder, in place?

Also: after setting remote PHPUnit,by poiniting it to phar file, I get

sftp://vagrant@localhost:2222/usr/bin/php /home/vagrant/.phpstorm_helpers/phpunit.php --no-configuration /vagrant/app/one/tests
Testing started at 4:03 PM ...

Process finished with exit code 1
Cannot find PHPUnit in include path (.:/usr/share/php:/usr/share/pear)

Comment actions Permalink

So, I'll reply myself again:

Had to use composer, add there

"require-dev": {
  "phpunit/phpunit": "4.1.0"

run composer install on vagrant,

Somehow it di not see classes when set up in PHPStorm usung path to phar.

Comment actions Permalink

Hi there,

How did you configure your PHP Remote Interpreter and what was your deployment option?

PhpStorm can run your PHPUnit tests over SSH (PHPUnit has to be installed on remote machine anyway) without you making changes in include paths in php.ini


Please sign in to leave a comment.