Symfony 2.0.9 Error on updating - symfony

when running php bin/vendors install i get the error:
Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in C:\Program Files (x86)\Zend\Apache2\htdocs\myproject\vendor\bundles\Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineCommand.php on line 18
And here is my deps file:
http://pastebin.com/FZYRzaFb
Is there a way i can fix this, maybe by setting different versions of bundles in deps files?

Yes, exactly, you must use version=origin/2.0 for the SensioGeneratorBundle
See this thread

Related

error when installing php unit

I'm working on an existing symfony project and need to use php unit.
When I tried to install it through composer with this command:
composer require --dev phpunit/phpunit ^5
But I got this error:
proc_open (): CreateProcess failed, error code -267
See screenshot here
If you refer to MS's error code reference, you'll see that error code 267 means that the directory name is invalid. So you've probably got an invalid directory reference in your configuration file.
Symfony has its own PHPunit bridge component that adds features on top of the library.
Install it by running this command at the root of your project:
composer require --dev symfony/phpunit-bridge
You should then be able to run your test scripts with:
./vendor/bin/simple-phpunit

PHPUnit working in IDE, but server says class not found

I am using the Symfony3 plugin in PhpStorm. My PHP Interpreter is 7.0.18. I have PHPUnit 6.3.0 configured in PhpStorm by having the .phar file in the root directory of my project.
Unit test work like a charm inside the IDE however performing any operation on the server (like bin/console server:start) triggers the following messages:
PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found in
/1tb/programming/PhpstormProjects/binary_search/src/AppBundle/Search/BinarySearchTest.php on line 13
PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found in
/1tb/programming/PhpstormProjects/binary_search/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/TestCase.php
on line 17
BinarySearchTest.php:
<?php
namespace AppBundle\Search;
use PHPUnit\Framework\TestCase;
class BinarySearchTest extends TestCase
{
}
TestCase.php:
<?php
namespace Symfony\Bundle\FrameworkBundle\Tests;
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
class TestCase extends PHPUnitTestCase
{
}
I have read many posts with problems similar but none of them describe the problem the way I do. Then I tried running PHPUnit with phpunit . in the root directory of the folder with this error:
PHP Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not
found in
/1tb/programming/PhpstormProjects/binary_search/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/ApcCacheTest.php
on line 10
It seems whatever I do I just run into more errors. I only just got started with Symfony and read a bit of the documentation but I can't get a grip on this thing, I have been at it for two days. Any suggestions for me?
I have PHPUnit 6.3.0 configured ... by having the .phar file in the root directory of my project
Such a bad idea. PHPUnit should not be installed on your (production?) server.
If this is a local staging server that you're trying to test on, then you need to install the phar in the path.
To globally install the PHAR:
$ wget https://phar.phpunit.de/phpunit-6.2.phar
$ chmod +x phpunit-6.2.phar
$ sudo mv phpunit-6.2.phar /usr/local/bin/phpunit
$ phpunit --version
Also, consider upgrading PHP to the newest version. There are several vulnerabilities in the one you're using. (See: change log for versions between yours and current).
EDIT:
Why are you running bin/console server:start on your server? Also not meant to be on a production server.
My guess here is that it is seeing the phar in your document root and trying to execute it, which is what is causing all the errors.
Installation of PHPUnit via composer worked. It turns out my composer installation went wrong in some way. After composer was successfully installed, I let it handle installing PHPUnit. After that it just worked. Tests work fine in the IDE and the server is responsive again. Thanks LazyOne.

Integrate PHPUnit with PhpStorm got error

I'm trying to set up my project with PHPUnit. I tried to configure PHPUnit with my project on PhpStorm following steps explained on this article.
http://blog.jetbrains.com/webide/2013/03/phpunit-installation-via-composer-in-phpstorm/
But when I try to run tests I continuously getting following error.
Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in C:\Users\win 8\AppData\Local\Temp\ide-phpunit.php on line 49
Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.;C:\wamp\bin\php\php5.6.19\pear') in C:\Users\win 8\AppData\Local\Temp\ide-phpunit.php on line 49
Process finished with exit code 255
I tried setting up number of new projects and in all the cases I get this stupid error. I don't know how to fix this. Please, your help is highly appreciated.
It seems that you are using PHPUnit through your IDE, and that the IDE has not provided PHPUnit with the correct include path items.
To understand about include path, and what is happening in your problem, see this post, part on inclusions by relative or absolute path and the include path.
To solve your problem, you will need to change a setting in your IDE, either to include the PHPUnit library in the general include path of running PHP, or in the include path of running PHPUnit.
It was version mis-match. I tried to integrate PHPUnit 5.3+ with PHPstorm 8.+ version. When I try PHPUnit 5.3+ with PHPStorm 2016.1 it worked as a charm.

Can't generate bootstrap file in Symfony 2.1.1

I've got an application written for Symfony 2.0 and I've started migrating it into Symfony 2.1. I've successfully installed all the dependencies with composer but a script fails...
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when generating the bootstrap file.
Any clue? I'm completely lost and I've googled it but I've only found a post in a forum with people having the same problem as me...
The problem is that the manual is not clear. It tells you to execute composer.phar install before telling that symfony-standard files need to be replaced.
So now you have to replace
AppKernel.php,
AppCache.php and
autoload.php (and remove odd files)
and update your config.yml file with the given tips.

Symfony 2.0 bundle installation

So I am a new to doctrine, but I am not able to install a bundle at all. I am following the guide, but the "error" which I am getting is very unusual.
Anyhow, I add this lines into deps file:
[FOSRestBundle]
git=http://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
Then I do:
./bin/vendors install
And I get:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Your project seems to be based on a Standard Edition that includes vendors.
Try to run ./bin/vendors install --reinstall
So on this standard way I am not able to install it at all. Can somebody explain me what is the problem, because to me it looks like, the symfony vendors script doesnt recognize changes in deps file at all.
This happens when you've downloaded the Symfony2 Standard Edition from the website. The vendor install script checks to see if the vendor directories are git repositories, and if not, will throw this error. You can fix the situation in one of two ways:
you can either run the command that it suggests: php bin/vendors install --reinstall
or, you can remove the vendors directory, then run php bin/vendors install, which amounts to about the same thing
No need to install that. Just follow the steps in the url : http://mmoreramerino.github.com/GearmanBundle/installation.html

Resources