Error running Symfony2 project: Class 'Doctrine\Tests\Common\Cache\CacheTest' not found

Hi, I'm currently evaluating PhpStorm at work with a view to getting it licensed and using it for a Symfony2 project, if all goes well.  I'm having difficulty setting up a default Syfomy2 project and running it, however.  I have been trying for quite some time to sort this out to no avail and have found nothing useful online.  So, I decided today to start from scratch on a fresh machine instaling Ampps and PhpStorm so I could list the steps I've taken to see if anyone can see where I'm going wrong.

I've pretty much left everything as default and changed as little as possible in PhpStorm to just get it to allow me to try and run the project.  I will list below the steps I've taken, but first the error I'm getting is:


----------

"C:\Program Files (x86)\Ampps\php\php.exe" C:/Users/<username>/AppData/Local/Temp/ide-phpunit.php --bootstrap C:\Users\<username>\PhpstormProjects\<project>\app\bootstrap.php.cache --configuration C:\Users\<username>\PhpstormProjects\<project>\app\phpunit.xml.dist C:\Users\<username>\PhpstormProjects\<project>
Testing started at 14:55 ...

Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not found in C:\Users\<username>\PhpstormProjects\<project>\vendor\doctrine\cache\tests\Doctrine\Tests\Common\Cache\ApcCacheTest.php on line 8
PHP Fatal error:  Class 'Doctrine\Tests\Common\Cache\CacheTest' not found in C:\Users\<username>\PhpstormProjects\<project>\vendor\doctrine\cache\tests\Doctrine\Tests\Common\Cache\ApcCacheTest.php on line 8

Process finished with exit code 255

----------


The OS I'm on is Windows 7 Pro SP1 64 bit, there are no issues with permissions on the directories in question and I'm running PhpStorm as administrator.  I've left Doctrine and everything else in Symfony's vendor directory so there is no issue with directories or files being in the wrong place or missing and I have checked that CacheTest.php exists where it should.  So, I'm completely at a loss to explain this.  Anyway, these are the steps I followed:


----------

Installed Ampps and changed the PHP version to 5.6 (5.6.9)

Installed PhpStorm 9.02

Installed PhpStorm Symfony2 plugin 0.11.96

Created a new project in PhpStorm, selecting 'Symfony Installer Project' as the project type and the default Symfony version of '2.7.3 (latest)', using PHP executable 'C:\Program Files (x86)\Ampps\php\php.exe'

In 'File > Settings > Other Settings > Symfony Plugins', the box 'Enable Plugin for this Project' was already ticked

In 'File > Settings > Languages & Frameworks > PHP' I've set the interpreter as PHP language level 5.6, again using the exe 'C:\Program Files (x86)\Ampps\php\php.exe'

In 'File > Settings > Languages & Frameworks > PHPUnit' I've selected the 'Path the phpunit.phar:' radio button and supplied the path to 'C:\bin\phpunit.phar', which I'd downloaded from https://phar.phpunit.de/phpunit.phar

Also in In 'File > Settings > Languages & Frameworks > PHPUnit', I've ticked the 'Default configuration file:' box and supplied the path 'C:\Users\<username>\PhpstormProjects\<project>\app\phpunit.xml.dist'

Finally, I attempted to run the project and received the error above.

----------


If anyone can offer any assistance it would be much appreciated, thanks!

4 comments
Comment actions Permalink

Hi there,

What are you actually trying to do?

Run your project (in a browser/command line) .. or execute PHPUnit tests?

0
Comment actions Permalink

Hi, thanks for your reply.  I'm just trying to run my project in a browser, which is what I expected running the project (clicking the green play icon) would do.  But, your reply has pointed me to the fact that I'm actually running PHPUnit tests (I assumed PHPUnit ran by default as part of the project when I saw it was coming up with errors, not that it was solely PHPunit that I was actually running).

Running PHPUnit tests is not too important at the moment, though I would be interested to find out why I'm getting these errors as I will need it further down the line.

Initially I want to be able to run the project in a browser without manually starting the project in a seperate command window and manually pointing a web browser to 127.0.0.1:8000, which is the only way I can find to do it at the moment.

Thanks again.

0
Comment actions Permalink

Well .. you have that "ampps" thing .. which includes Apache (web server). So .. configure Apache to serve your project (using virtual hosts would be the best way -- close to real web suite setup) either from that location directly .. or use automatic deployment functionality of PhpStorm to copy files into another place. This way your app will always be ready to be used (as long as Apache is started).

I want to be able to run the project in a browser without manually starting the project in a seperate command window and manually pointing a web browser to 127.0.0.1:8000

You may write .cmd file which will do that or you ... and then use External Tools functionality to execute that batch file. Custom shortcut can be assigned to such entry if necessary.

P.S.
Although you can do "open specific url in browser" via Run/Debug configurations functionality (originally mentioned "Run" button -- entry of "PHP Web Application" type) and use "Run External Tool" as "Before launch" step .. such command will be run each time you will be using it .. which is not always a desired action (plus, you still have to create external tools entry to actually execute DOS/Terminal commands).

P.P.S.
I personally suggest use proper web server, be it Apache or even IIS (it comes with Windows Vista and later)

0
Comment actions Permalink

Thanks very much, Andriy, for taking the time to help me with this.  I clearly misunderstood the behaviour of the 'run' button - I'm so used to developing desktop apps in RAD IDEs that I became used to just clicking run to see the application as a user would.  Obviously the situation is a little more complicated in PhpStorm with it catering for so many different development scenarios.

I agree the best way is to use Apache to serve the project and external tools to (re)start the Symfony project, which is what I'll do.  Thanks again.

0

Please sign in to leave a comment.