Working all day to deploy my application to heroku, but every time it throws out an error. And i am all out of clues, and have a very angry customer.
When i try to add my project to heroku with the command git push heroku master every thing is fine till the cache needs to be cleared.
Updating the "app/config/parameters.yml" file
remote: > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
remote: > Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
remote: Could not open input file: app/console
remote: Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception
remote:
remote:
remote: [RuntimeException]
remote: An error occurred when executing the "'cache:clear --no-warmup'" command:
remote: Could not open input file: app/console
remote: .
You would think, it's the same as this git issue
Also a know problem, that i am using a wrong type of mapping.
But i think it's fine.
I updated my composer and cleared the cache of my composer
And when i clear the cache with php bin/console cache:clear everything is fine!
I followed this tutorial
And got some side information from the symfony site.
Also found this stack - with the explanation what is going on, but this is still not solving my problem.
Maybe it's somewhere in my composer file, or my git ignore.
But honestely, i have no idea anymore.
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": { "": "src/" },
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "Tests\\": "tests/" }
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.1.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"symfony/assetic-bundle": "^2.8",
"stfalcon/tinymce-bundle": "2.0",
"egeloen/ckeditor-bundle": "^4.0",
"whiteoctober/tcpdf-bundle": "^1.0",
"gregwar/captcha-bundle": "^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
],
"compile": [
"rm web/app_dev.php",
"bin/console cache:clear",
"bin/console assetic:dump"
]
},
"config": {
"platform": {
"php": "5.5.9"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.1-dev"
}
}
}
The solution that worked for me. New Symfony 3 installation: Could not open input file: app/console in composer install
EXPLANATION:
That's what I guess. When you push your code to Heroku, the platform compiles your project files on the /tmp dir. What happens if you don't have a var dir when Heroku compiles your code? What happens is that Symfony creates a new one:
vendor/sensio/distribution-bundle/Composer/ScriptHandler.php:462
protected static function useNewDirectoryStructure(array $options)
{
return isset($options['symfony-var-dir']) && is_dir($options['symfony-var-dir']);
}
Then when Heroku moves your new code to the /appdir, the Symfony configuration still points to the old placement /tmp, but files placed at /tmp are now deleted!
You upgraded a Symfony 2 app to 3.
But it is not sufficient to change the requirements in composer.json.
The structure changed, so you need to first create a new fresh app with Symfony 3 and then move the old Symfony 2 app to the fresh Symfony 3 one, bundle by bundle, composer requirement by composer requirement.
This way you'll be sure your app will work well on version 3.
If you try to simply upgrade the requirements from a Symfony 2 app, then you'll create a lot of bugs, as the scripts changed, the structure changed, the requirements changed...
The only safe way is to start a new Symfony 3 project and then port the old Symfony 2 into it.
I took a look at your github repository. Seems like it's in the Symfony3 format, so I'm not certain what is going on. I want to try something, but I'm not sure if it will work.
Try editing your composer.json file manually to add the bin directory:
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.5.9"
}
},
Then see if that fixes the problem.
EDIT #2
Now revert those changes and try this:
"extra": {
"symfony-app-dir": "bin",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
In other words change the app directory to "bin".
Related
I created a php project (by cmd >composer create-project symfony/framework-standard-edition projectname) which I initially assigned the 5.6 php version. Later, in PhpStorm I decided to change it to the 7.1 thourgh Settings/Languages & Frameworks/PHP...
The problems is that when I installed PhpUnit (7.1 version) in that project, I got the compatibility error of that my php version was 5.6
Understanding that the "Settings way" din´t work, I went to the composer.json, when I though there is the problem:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
},
"autoload-dev": {
"psr-4": { "Tests\\": "tests/" },
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"phpunit/phpunit": "5.6.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^5.0.0",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.6.4",
"symfony/symfony": "3.4.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
]
},
"config": {
"platform": {
"php": "5.6"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
My question is: which specific lines must I change and if there are another place/s of the project to look for.
Edit:
After changing the php versions in
"config": {
"platform": {
"php": "7.1"
},
and
"require": {
"php": "^7.1",
I've executed the composer update and although this time I don't get the previous error, it appears instead another new one:
Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected ')' in (file route) on line 25
But I don't see why the line with the code return $this->render(...); is incorrect since my php file is based on the official tutorial https://symfony.com/doc/3.4/email.html
<?php
namespace AppBundle\Controller;
use Symfony\Component\HttpKernel\Tests\Controller;
class SendCustomerEmailController extends Controller
{
public function indexAction($name, $email, $originEmail, \Swift_Mailer $mailer)
{
$message = (new \Swift_Message('Pago reserva'))
->setFrom($originEmail)
->setTo($email)
->setBody(
$this->renderView(
'emails/email-template.html.twig',
array('name' => $name)
),
'text/html'
);
$mailer->send($message);
return $this->render(...);
}
}
If the syntax is incorrect, why didn't PhpStorm warned me?
You should install php7.1 to your system first to be able to use it.
For ubuntu:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
For windows and other OS just google it (e.g. How can I install php on Windows).
Then you should say PHPUnit to use specific version of php, but it depends on how exactly you run tests.
See Run test in phpunit with specific php version
or
PHPUnit - This version of PHPUnit requires PHP 5.6; using the latest version of PHP is highly recommended - OSX 10.11
You should install PHP 7.1 if you using PhpUnit 7.1
Change this line
"php": ">=5.5.9"
To
"php": "^7.1"
After that execute composer update
You have the wrong syntax for rendering :
$this->render(...);
You should specify a template or calling a custom Twig function
https://symfony.com/doc/current/templating/embedding_controllers.html
Something like that :
return $this->render('folder/exemple.html.twig');
Its is possible that you are using the wrong library? I just take a look in my controllers and the class whateverController extends Controller. This "Controller" comes from the line "use Symfony\Bundle\FrameworkBundle\Controller\Controller;"
Try to change your:
use Symfony\Component\HttpKernel\Tests\Controller;
for:
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
In PHPStorm under "Settings" - "Languages & Frameworks" - "PHP" you have two dropdown selections:
"PHP language level"
"CLI interpreter"
Changing the former will not necessarily change the latter. But the CLI interpreter is the PHP version being used for Composer and test execution. If you have PHP 5.6 there, Composer will not properly update dependencies, and tests will fail because PHP 7.1 syntax cannot be executed by PHP 5.6.
Install PHP 7.1, then add the CLI interpreter (the three dots at the end of that dropdown).
Hint: You can have more than one PHP version installed in PHPStorm if you know how to install to different directories. It's easy on Windows (you simply download a version and unzip, then point PHPStorm to the php.exe inside), and may be more complicated on Linux.
I updated my vendors for a Symfony 2.8 project and suddenly the login page isn't loading – instead I get this:
Error: Call to a member function has() on a non-object in
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
at line 184
"name": "hazardlog",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.11.1",
"dist": {
"url": "https://code.jquery.com/jquery-1.11.1.js",
"type": "file"
}
}
}
],
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"braincrafted/bootstrap-bundle": "~2.0",
"twbs/bootstrap": "3.0.*",
"jquery/jquery": "1.11.*",
"hwi/oauth-bundle": "^0.5.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"stephanecollot/datetimepicker-bundle": "dev-master"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"#symfony-scripts"
],
"post-update-cmd": [
"#symfony-scripts"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
I have seen this sort of question several times but I could not find one with an accepted answer and explanation. So here goes.
The basic problem lies with:
"friendsofsymfony/user-bundle": "~2.0#dev",
Back when Symfony 2.8/3.0 was first released, the stable 1.x version of FOSUserBundle no longer worked. The 2.x version has been in development for years with no actual road map in sight for when it would be stabilized. So the development branch was hacked up to get it working. And folks had no choice but to use it which of course is dangerous because you never know when a development change might in fact break your code.
Time went by and eventually a stable 2.x version of the FOSUserBundle was released. However, quite a few developers never got around to updating their dependencies and continued to use the master branch.
Fast forward to the present. The release of Symfony 4 has now triggered a fair amount of development in the master branch. Development which is introducing breaking changes to existing 2.8 (and probably 3.0) code.
The bottom line is to use a stable branch with:
"friendsofsymfony/user-bundle": "~2.0",
followed by a composer update.
For those using Symfony 3.2, it looks like version "~2.1" throws same error along with the OP's version "~2.0#dev".
This worked:
"friendsofsymfony/user-bundle": "2.0"
Keeping it at 2.0 did the trick for me.
had a problem like this here but solved,i just did the opposite of this.
i had:
"friendsofsymfony/user-bundle": "^2.1",
in my composer.json file which give me a Call to a member function has() on null error to solve this i Actually add "#dev it became:
"friendsofsymfony/user-bundle": "^2.1#dev",
then updated my composer with :
composer update
I've recently installed symfony 3, and while it seems to be working okay, I noticed that my error logs keep filling up with the following message.
[10-Jan-2016 01:03:11 America/Chicago] PHP Warning: Module 'intl' already loaded in Unknown on line 0
After looking into it, I set these in my composer.json file to see if it would help.
"symfony/intl": "^3.0.1",
"symfony/polyfill-intl-icu": "^1.0"
but I still see the errors after I do anything with the page, like refresh it, or try to enter in my login etc...
The full composer.json is below with my domain name replaced with example.com for security reasons.
{
"name": "root/example.com",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.0.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"symfony/intl": "^3.0.1",
"symfony/polyfill-intl-icu": "^1.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^2.7"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
Also I tried following the advice on a question similar to mine here (Problems installing Symfony 2.4.1 lib-icu 4.4 dependency), but when I tried to set "symfony/icu": "1.1.*", composer refused to do it because I'm using symfony 3...
I'm not even sure if my issues are same as his.
I'm using WHM/Cpanel on Centos Linux Server in case there is any UNIX commands I need to run to solve this.
I believe I have installed the intl extension already via the WHM control panel as well, but I'm not 100% sure I did this correctly either. I've attached an image of how it looks in my control panel.
I've also tried following instructions here (http://symfony.com/doc/current/components/intl.html)
How do I get rid of the error message?
I believe this is not Symfony related.
Usually the case is your installed PHP version compiled with --with-intl option (intl built-in) and you have also installed intl extension.
Try to disable/ uninstall the intl extension and test if you can still use symfony/intl features without issues.
SensioDistributionBundle before v5.0.17 creates this kind of errors when used with Composer v1.3 (more details).
Check if you could be affected:
composer --version && composer show | grep distribution-bundle
If so, get rid of the problem by updating SensioDistributionBundle to the latest version:
composer update sensio/distribution-bundle
I am new to Symfony and I was assigned a Symfony 2 project.Now I am facing some problem with app/console server:run.
The project is a working system, therefore the problem should be because of my limited knowledge in Symfony framework.
this is what I keep getting
proc_open() : CreateProcess failed, error code - 267 in C:\xampp\htdocs\xxx\vendor\symfony\symfony\src\Symfony\Component\Process\Process.php on line 246.
line 246 is this part
$this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options);
I have tried changing the $this->cwd to "C:/xampp/htdocs/xxx", it can run but it will have another problem which is after I visit localhost:8000, it shows this
Warning: require(app_dev.php): failed to open stream: No such file or directory in C:\xampp\xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Resources\config\router_dev.php on line 30
Fatal error: require(): Failed opening required 'app_dev.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Resources\config\router_dev.php on line 30
Any ideas what is wrong?
EDIT:
I have updated all my files as suggested my Matteo, a few issues came up with the vendors and I have solved it for new (hopefully). However now I am stuck at another problem which is this
The given document root directory "C:/xampp/htdocs/xxx/app/../web" does not exist.
As mentioned in the comments, I do not have a folder called "web". It was renamed to public. I have already changed the composer.json but it does not seem to do anything.
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"richsage/rms-push-notifications-bundle": "dev-master",
"friendsofsymfony/user-bundle": "~1.3",
"ircmaxell/password-compat": "~1.0.3"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "public",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}
}
If I type app/console --version in cmd, it shows Symfony version 2.6.1 - app/dev/debug
Please help me out.
It's a bug as described here. It is resolved in the current framework version (2.6.1).
So the solution is to upgrade to the current version. You can verify in the UPGRADE files on the github repo is something is changed but there anren't BC (Break Compatibility).
In addition, your current framework version (2.4.2) is out of support so is a good moment to do this task.
In general is a good practice to upgrade to the last stable version of the framework. Take a look at the sf2 release roadmap for the release process and for the end of support of the various framework release.
Hope this help
I'm trying to install the MopaBootstrapBundle, I created a view with the following code:
{% extends 'MopaBootstrapBundle::base.html.twig' %}
{% block title %}Yourapp{% endblock %}
{# and define more blocks ... #}
but when I navigate to that view I get the following exception:
An exception has been thrown during the compilation of a template ("Unable to find file "#MopaBootstrapBundle/Resources/bootstrap/js/bootstrap-transition.js".") in "MopaBootstrapBundle::base.html.twig".
I believe this may be due to not being able to install LESS, I get the following error:
C:\xampp\htdocs\Project>php app/console mopa:bootstrap:symlink:less
'which' is not recognized as an internal or external command,
operable program or batch file.
'which' is not recognized as an internal or external command,
operable program or batch file.
[RuntimeException]
Could not find composer.phar
mopa:bootstrap:symlink:less [-f|--force] [-m|--manual] [--no-symlink] [pathToTwi
tterBootstrap] [pathToMopaBootstrapBundle]
Even though I have composer installed and it works when I do the following:
C:\xampp\htdocs\Project>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Updating the "app/config/parameters.yml" file.
Clearing the cache for the dev environment with debug true
Installing assets using the hard copy option
Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
Installing assets for FL\FifaLeagueBundle into web/bundles/fifaleague
Installing assets for Mopa\Bundle\BootstrapBundle into web/bundles/mopabootstrap
Installing assets for Acme\DemoBundle into web/bundles/acmedemo
Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodi
stribution
Checking Symlink ... OK
My composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.9.1",
"dist": {
"url": "http://code.jquery.com/jquery-1.9.1.js",
"type": "file"
}
}
},
{
"type": "package",
"package": {
"version": "master",
"name": "twbs/bootstrap",
"source": {
"url": "https://github.com/twbs/bootstrap.git",
"type": "git",
"reference": "master"
},
"dist": {
"url": "https://github.com/twbs/bootstrap/zipball/master",
"type": "zip"
}
}
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0#dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures" : "dev-master",
"leafo/lessphp": "dev-master",
"mopa/bootstrap-bundle": "dev-master",
"twbs/bootstrap": "dev-master",
"knplabs/knp-paginator-bundle": "dev-master",
"knplabs/knp-menu": "2.0.*#dev",
"knplabs/knp-menu-bundle": "dev-master",
"craue/formflow-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
Well, if you look at source code, you'll see that the error comes from library not able to find it in your system, specifically I'm assuming that this line fails because windows doesn't have which command.
I'm guessing the solution would be to use composer.phar file directly in project directory.
If you examine the twbs/bootstrap bundle you might find that it has installed, among other scripts, transition.js but mopabootstrapbundle base.html.twig requests bootstrap-transition.js. If this is the case I think you're going to have to rename the scripts or edit base.html.twig. I had twitter/bootstrap, which contains bootstrap-transition.js installed, so I adjusted the symlink.
I'm not sure what the package actually gives me.