I recently inherited a bunch of Symfony2 projects from a former colleague. I'm trying to get up to speed with them but without any documentation on specifically what he did I'm struggling to even get them up and going. At this point I've installed the vendors/bin via composer install but at the last minute I get the following error
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
PHP Warning: require(/Users/[path to symfony project]/vendor/tobie/ua-parser/php/uaparser.php): failed to open stream: No such file or directory in /Users/[path to symfony project]/vendor/composer/autoload_real.php on line 54
PHP Fatal error: require(): Failed opening required '/Users/[path to symfony project]/vendor/tobie/ua-parser/php/uaparser.php' (include_path='.:') in /Users/[path to symfony project]/vendor/composer/autoload_real.php on line 54
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when generating the bootstrap file.
As a note, I've confirmed I'm running the newest version of Composer.
Has anyone run into this before? I've been searching google for the past 2 days have yet to find a solution.
Thanks!
Related
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
I just installed a copy of Sylius (built on Symfony2), and am trying to update composer to get it working. When I run composer update, it tries to clear the cache:
An error occurred when executing the "'cache:clear --no-warmup'"
command:
This is when it hits the error:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "security.authentication.manager" has a dependency on a non-existent service "sylius.user_provider.name_or_email".
I've seen similar errors related to "security.user.provider.concrete.fos_userbundle", but I can't seem to find any help on "sylius.user_provider.name_or_email".
This is a fresh install of the newest version of Sylius, so I'm not sure why it's having trouble finding the dependancy.
edit: I saw some suggestions that the cache clear needs to be run in the same directory as the site (which is where I'm running the composer update from), but I still tried running this as its own command:
cache:clear --no-warmup
From within the root dir of the Sylius install, to no avail. It throws the same error as above.
first of all I would like to say that I'm relatively new to symfony and I work with Netbeans.
My first problem occurs when I'm trying to install ccdn-forum-bundle like it's said here:
https://github.com/codeconsortium/CCDNForumForumBundle/blob/master/Resources/doc/install.md
When I try to update-dev with composer I get this error:
[RuntimeException]
Failed to execute git status --porcelain --untracked-files=no
"git" is not recognized as an internal or external command, operable program or batch file.
It occurs when composer is trying to update friendsofsymfony/user-bundle and when I try to run my project I get this error from symfony:
ClassNotFoundException: Attempted to load class "MonologBundle" from namespace "Symfony\Bundle\MonologBundle" in C:\xampp\htdocs\PortalInternoHUPR\app\AppKernel.php line 14. Do you need to "use" it from another namespace?
I tryed to fix it by running install dev in composer, but then I get this other one:
Fatal error: Class 'Knp\Bundle\PaginatorBundle\KnpPaginatorBundle' not found in C:\xampp\htdocs\MyProject\app\AppKernel.php on line 23
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command.
Thanks.
Try not to use netbeans, and install the bundle directly from the prompt
First check if git is correctly installed
git –version
Then run
php composer.phar update
If that didn’t work for you, I suggest making a fresh install using --prefer-dist option
php composer.phar install --prefer-dist
I install Symfony 2.3.0-DEV this way:
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
But, Every time I've had to rename (ie. to "test2") the project folder. My installation breaks and shows errors:
Warning: require_once(C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache' (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
I tried, deleting cache folders, deleting the bootstrap.cache.php file, and re-installing/updating vendors, including the autoloader, also with cache:warmup and cache:clear, changing permissions. And still nothing...
Finally solved it ! That's what I've done.
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
Loaded http://localhost/symfony-projects/test1/web/app_dev.php once.
Closed the browser (chrome), stopped xampp (apache/mysql), and the powershell
Deleted /app/cache/* and /app/bootstrap.php.cache file
Closed the IDE, Logoff my user session in Windows 8 (starting feeling paranoid)
Renamed the folder test1 to test2
Executed composer update command to call post-update-cmd scripts to be sure that bootstrap.php.cache is rebuild
Went to http://localhost/symfony-projects/test2/web/app_dev.php
And then works. Probably that issue was due to locked files...
#Touki Thanks, the APC thing was a good insight but not needed it ;)
this topic is quite old but I just had the same problem. The problem was: I installed symfony2 using command:
php composer.phar create-project symfony/framework-standard-edition myProject 2.1.x-dev
but I had the same fatal error. However, my solution was to go myProject directory and run command:
composer update
And that is all, project was rebuilded and file "bootstrap.php.cache" appeard :)
I hope this helps.
Next time, just restart your machine.
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.