At first, sorry for stupid question but I'm new in Heroku as in Symfony. I'm learning Symfony and now trying to deploy my app to Heroku. But after push to heroku I have error I can't solve. I searched for answers but didn't find the solution. My enviroment is switched to PROD. Here is bunch of files I think can be usefull to analyze.
Initializing repository, done.
Counting objects: 8783, done.
Delta compression using up to 3 threads.
Compressing objects: 100% (7959/7959), done.
Writing objects: 100% (8783/8783), 6.34 MiB | 499.00 KiB/s, done.
Total 8783 (delta 2737), reused 0 (delta 0)
-----> PHP app detected
-----> Resolved composer.lock requirement for PHP >=5.3.3 to version 5.6.2.
-----> Installing system packages...
- PHP 5.6.2
- Apache 2.4.10
- Nginx 1.6.0
-----> Installing PHP extensions...
- zend-opcache (automatic; bundled, using 'ext-zend-opcache.ini')
-----> Installing dependencies...
Composer version 1.0-dev (a309e1d89ded6919935a842faeaed8e888fbfe37) 2014-10-20 19:16:14
! WARNING: You have put Composer's vendor directory under version control.
That directory should not be in your Git repository; only composer.json
and composer.lock should be added, with Composer handling installation.
Please 'git rm --cached vendor/' to remove the folder from your index,
then add '/vendor/' to your '.gitignore' list to remove this notice.
For more information, refer to the Composer FAQ: http://bit.ly/1rlCSZU
Loading composer repositories with package information
Installing dependencies from lock file
- Removing sensio/generator-bundle (v2.4.0)
Generating optimized autoload files
Updating the "app/config/parameters.yml" file
PHP Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /tmp/build_a721f054a4c0177a8e4e060c5b747b1c/app/AppKernel.php on line 26
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.
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
! Push rejected, failed to compile PHP app
Here is composer.json content:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.5.*",
"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": "~3.0",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.0",
"sensio/generator-bundle": "~2.4"
},
"require-dev": {
},
"scripts": {
"post-root-package-install": [
"SymfonyStandard\\Composer::hookRootPackageInstall"
],
"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::removeSymfonyStandardFiles"
],
"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::removeSymfonyStandardFiles"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.5-dev"
}
}
}
and AppKernel.php content:
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Irishdash\StorageBundle\IrishdashStorageBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
You want to run heroku config:set SYMFONY_ENV=prod before you push, otherwise the post-install-cmd scripts will run in the dev environment, which needs the generator bundle, but that one is not available as Heroku only installs packages from require, not from require-dev, during a push (using Composer's --no-dev mode).
First of all, please follow the instructions received in the warning by Heroku.
Please 'git rm --cached vendor/' to remove the folder from your index,
then add '/vendor/' to your '.gitignore'
Then commit the changes for the .gitignore file to Git.
Next, it's installing dependencies from the lock file, but looks like you've moved the sensio/generator-bundle package to require from require-dev.
Given this, try running php composer.phar update and then commit the changes for the composer.lock file to Git.
Also you may need composer.lock file in your app
Related
Context
I'm currently working on an OroPlatform project, which is based on Symfony 4.4 and deployed on Platform.sh.
I'm facing the following issue during the build phase of the deployment:
My app needs the package symfony/process 4.4.X
I don't know why, but on the Platform.sh server my app uses the symfony/process package installed for the composer binary installed globally, but this one is a 5.X version
So, I've got an error and I can't install my app because it uses the 5.X version instead of the 4.X
That's why I've found a workaround by using Composer 1.9.3 because it uses symfony/process 4.4.X, the same used by my app.
It was working well, but yesterday I have to bump the composer version to latest 1.X due to the Github OAuth token changes: https://nono.ma/github-oauth-token-for-github-com-contains-invalid-characters-on-composer-install
Issue
So, I'm still facing this issue with the 4.X version and the 5.X version.
I've tried to install the dependencies of my project this way : composer install -n -o -a but the bug still occurs.
I'm looking for a way to force my project to use the dependencies located in the vendor folder of my app and not the ones installed globally. Here is a screenshot of the issue on the Platform.sh server:
And here is a schema of the path of my app and composer on a Platform.sh server:
/app
|
|__/vendor/symfony-process
|
|__/.global/vendor/symfony-process
My composer.json:
{
"name": "oro/platform-application",
"description": "Oro Platform Empty Application",
"homepage": "https://github.com/oroinc/platform-application.git",
"license": "MIT",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"src/AppKernel.php",
"src/AppCache.php",
"vendor/oro/platform/guzzle/Client.php"
],
"exclude-from-classmap": [
"/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php",
"**/Tests/"
]
},
"repositories": {
"composer": {
"type": "composer",
"url": "https://packagist.orocrm.com"
}
},
"require": {
"php": "~7.3.13 || ~7.4.2",
"oro/platform": "4.1.*",
"oro/platform-serialised-fields": "4.1.*",
"oro/oauth2-server": "4.1.*",
"doctrine/doctrine-migrations-bundle": "^3.0"
},
"require-dev": {
"behat/behat": "3.4.*",
"behat/gherkin": "4.6.0",
"behat/mink": "dev-master#6d637f7af4816c26ad8a943da2e3f7eef1231bea",
"behat/mink-extension": "2.3.*",
"behat/mink-selenium2-driver": "1.3.1",
"behat/symfony2-extension": "2.1.*",
"guzzlehttp/guzzle": "^6.0.0",
"nelmio/alice": "3.6.*",
"theofidry/alice-data-fixtures": "1.0.*",
"phpunit/phpunit": "7.5.*",
"johnkary/phpunit-speedtrap": "3.0.*",
"mybuilder/phpunit-accelerator": "dev-master",
"squizlabs/php_codesniffer": "3.5.*",
"phpmd/phpmd": "2.6.*",
"sebastian/phpcpd": "4.0.*",
"phpunit/phpcov": "5.0.*",
"symfony/phpunit-bridge": "4.4.*",
"friendsofphp/php-cs-fixer": "2.16.*",
"oro/twig-inspector": "1.0.*"
},
"config": {
"component-dir": "public/bundles/components",
"bin-dir": "bin",
"fxp-asset": {
"enabled": false
}
},
"scripts": {
"post-install-cmd": [
"#build-parameters",
"#set-permissions",
"#install-assets",
"#set-assets-version"
],
"post-update-cmd": [
"#build-parameters",
"#set-permissions",
"#update-assets",
"#set-assets-version"
],
"build-parameters": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"set-permissions": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setPermissions"
],
"install-assets": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::installAssets"
],
"update-assets": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::updateAssets"
],
"set-assets-version": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ScriptHandler::setAssetsVersion"
],
"set-parameters": [
"Oro\\Bundle\\InstallerBundle\\Composer\\ParametersHandler::set"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"symfony": {
"require": "4.4.*"
},
"symfony-web-dir": "public",
"symfony-var-dir": "var",
"symfony-bin-dir": "bin",
"symfony-tests-dir": "tests",
"incenteev-parameters": {
"file": "config/parameters.yml"
}
}
}
Finally I've supposed that installing composer under the same folder as the web application don't seems to be a good practise. Moreover, it seems that Platform.sh don't use the composer binary.
So, I have change the build phase inside my .platform.app.yaml to avoid the way Platform.sh install Composer and use a custom way to do it:
# .platform.app.yaml
hooks:
build: |
set -e
cd $PLATFORM_APP_DIR
# install Composer
chmod +x composer-install.sh
./composer-install.sh
# composer-install.sh
#!/bin/sh
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --1 --quiet
RESULT=$?
rm composer-setup.php
>&1 echo 'Composer successfully installed'
exit $RESULT
Try installing the package, so it will be added to your composer.json file.
composer install symfony/process
The following section will cause the correct version to be installed
"extra": {
"symfony": {
"require": "4.4.*"
},
Once you've run the command, the package should be added as follows :
"symfony/process": "4.4.*"
If it does not, change it to that version number and run
composer update symfony/process
Symfony 2.8 is the last release of the 2.x branch and the previous LTS.
Symfony 3.4 is the last release of the 3.x branch and the current LTS.
What steps are required in order to upgrade Symfony from 2.8 to 3.4 and switch to this last LTS?
Prepare upgrade
Check that all the dependencies and bundles listed in composer.json have published a version compatible with Symfony 3.4, you can do this by searching each package on Packagist, for example EasyAdmin is compatible with Symfony 3 because the dependencies in the requires are not limited to Symfony 2 (we would see something like symfony/*: ~2.3). If one of the dependencies it not compatible with Symfony 3, you'll have to find replacement packages or patch these libraries.
composer.json
In order to upgrade you app from Symfony 2.8 to Symfony 3.4 you'll have to update your dependencies by changing your composer.json file:
([…] indicates unchanged code)
Old (2.8) version:
{
[…]
"autoload-dev": {
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": ">=5.3.9",
"doctrine/doctrine-bundle": "~1.4",
"doctrine/orm": "^2.4.8",
"incenteev/composer-parameter-handler": "~2.0",
"sensio/distribution-bundle": "~4.0",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.0.2",
"symfony/swiftmailer-bundle": "~2.3,>=2.3.10",
"symfony/symfony": "2.8.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.6"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
[…]
"branch-alias": {
"dev-master": "2.8-dev"
}
}
}
New (3.4) version:
{
[…]
"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",
"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"
},
"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",
[…]
"branch-alias": {
"dev-master": "3.4-dev"
}
}
}
Summary
autoload-dev.psr-4 has been added (it has to be changed with the path to your tests directory)
Symfony and dependencies are updated
symfony/polyfill-apcu is a new dependency
extra has been updated in order to use new directory structure: var for temporary files, etc.
config.bin-dir has been removed
More details about upgrades: → 3.0, → 3.1, → 3.2, → 3.3, → 3.4
app/AppKernel.php
Add getRootDir and update registerContainerConfiguration functions:
public function getRootDir()
{
return __DIR__;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
Cache and logs
If you want to put cache and logs in var/, you have to update your app/AppKernel.php file by adding the following lines:
public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
}
public function getLogDir()
{
return dirname(__DIR__).'/var/logs';
}
Then create the var/ directory and put an empty file .gitkeep
And apply these changes to your .gitignore file:
/var/cache/*
/var/logs/*
!var/cache/.gitkeep
!var/logs/.gitkeep
See also: What is the new Symfony 3 directory structure?
Final steps
Once you have updated your composer.json file, you have to update the dependencies:
composer update
Then you may need to flush the cache:
php app/console cache:clear --env=dev
Note: I used the following command in order to get the composer.json files:
# create Symfony "2.8.*" project in the "2.8" directory
composer create-project symfony/framework-standard-edition "2.8" "2.8.*" --no-interaction -v
# create Symfony "3.4.*" project in the "3.4" directory
composer create-project symfony/framework-standard-edition "3.4" "3.4.*" --no-interaction -v
# compare the Symfony 2.8 and 3.4 composer.json files
diff -u 2.8/composer.json 3.4/composer.json
The diff is available at GitHub too.
Bonus: enable autowiring of services.
2019+ Instant Upgrades Version
Today, you can automate most of the work with instant upgrade tool called Rector (I'm author of). It has prepared sets for many frameworks, the Symfony ones are most complete. Also include PHP upgrade, that you might need.
You can read more about this particular upgrade path in: How to Upgrade Symfony 2.8 to 3.4
all my Code is splitted into bundles, which i require with the composer.json.
Now i want to install the whole project with composer install, but when i try it out, the symfony folders doesn't appear and i get the following error message:
[RuntimeException]
Could not scan for classes inside "app/AppKernel.php" which does not appear to be a file nor a folder
Is there a way to request the symfony installation files ?
This is my composer.json:
{
"name": "mygloriousname",
"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.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"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"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"
}
}
}
I think what you are looking for is create-project.
This is how you can install Symfony via composer
composer create-project symfony/framework-standard-edition my_project_name
This command does the following steps:
takes the project for symfony/framework-standard-edition from packagist
downloads the repository: https://github.com/symfony/symfony-standard
runs composer install in that newly downloaded project
edit: Obviously for your use case you have to replace symfony/framework-standard-edition with your project identifier and either put it on packagist, your own composer repository (e.g. with Toran Proxy) or register the repository in your global composer config.
You can probably find a few more examples usually as part of some kind of skeleton application.
While this is doable it's not the preferred way for deploying an application for a good reason. You can't just update a project like this only replace the existing one, which will cause downtime or require some symlink-juggling and even then has some drawbacks. Also you still have to run all the initial setup steps, like specifying the database connection info, each time. You could work around this (or manually type in all these parameters), but having a real deployment tool for example using ansible will be a much better choice for a scenario like this.
I'm getting error below when trying to install Behat+Mink+Selenium. What could be the solution?
php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
- symfony/framework-standard-edition 2.4.x-dev requires behat/behat 2.4.*#stable -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Composer.json:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"minimum-stability": "dev",
"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",
"behat/behat": "2.4.*#stable",
"behat/mink": "1.4.*#stable",
"behat/mink-extension": "*",
"behat/mink-goutte-driver": "*",
"behat/mink-selenium2-driver": "*",
"behat/symfony2-extension": "*",
"behat/mink-browserkit-driver": "*",
"behat/mink-sahi-driver": "*",
"phpunit/phpunit": "3.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"
],
"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": "web",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.4-dev"
}
}
}
I'm following these two blogs to install it:
Installing, configuring and running Behat on Symfony2 with Mink and
Selenium
Installing Behat, Mink and Selenium2 for Symfony2
IMO, you have registered too many packages. For example, behat is a dependency of the symfony2-extension. So, just need to require the symfony2-extension and behat will be required :) The problem when you require everything explicitly is you need to check if every packages constraints can work together on packagist (which can becomes a pain)...
For a Symfony 2.4 project, I would use the following packages:
"require-dev": {
"behat/symfony2-extension": "~1.1",
"behat/mink-extension": "~1.3",
"behat/mink-selenium2-driver": "~1.1",
"behat/mink-goutte-driver": "~1.0",
}
I would suggest run composer require, and before you installing do a composer update so that all dependencies are at updated version. So the below dependencie were usesful for my symfony2.8 project:
composer update
composer require behat/behat
composer require behat/symfony2-extension
composer require behat/mink
composer require behat/mink-browserkit-driver
composer require behat/mink-extension
composer require behat/mink-goutte-driver
composer require behat/mink-selenium2-driver
composer require emuse/behat-html-formatter
composer require coduo/php-matcher
Since Im getting error messages about the icu version When running php composer.phar install, I have added this line below as said here:
"symfony/icu": "1.1.*",
So my composer.json is like this:
{
"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/icu": "1.1.*",
"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",
"ziiweb/frontendbundle": "#dev",
"friendsofsymfony/user-bundle": "~2.0#dev",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/core-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/media-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"
],
"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"
},
"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"
}
}
}
But after installing again, I get this errors:
Problem 1
- The requested package symfony/icu could not be found in any version, there may be a typo in the package name. Problem 2
- Installation request for symfony/framework-standard-edition 2.3.x-dev -> satisfiable by symfony/framework-standard-edition[2.3.x-dev].
- symfony/framework-standard-edition 2.3.x-dev requires symfony/icu 1.1.* -> no matching package found. Problem 3
- Installation request for symfony/symfony v2.3.8 -> satisfiable by symfony/symfony[v2.3.8].
- symfony/symfony v2.3.8 requires symfony/icu ~1.0 -> no matching package found. Problem 4
- symfony/symfony v2.3.8 requires symfony/icu ~1.0 -> no matching package found.
- sonata-project/media-bundle 2.2.x-dev requires symfony/symfony ~2.2 -> satisfiable by symfony/symfony[v2.3.8].
- Installation request for sonata-project/media-bundle 2.2.x-dev -> satisfiable by sonata-project/media-bundle[2.2.x-dev].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details
.
it is "symfony/Icu" with capital letter
You need to download the INTL extension of PHP.Go to http://pecl.php.net/get/intl-3.0.0.tgz
Tar that file, and compile it with the following commands.
tar zxvf intl-3.0.0.tgz
cd intl-3.0.0
/usr/bin/phpize
./configure --with-php-config=[YOUR OWN INSTALLED PHP DIRECTORY]/bin/php-config
Update your php.ini.
extension=intl.so
Restart your php server
By the way, if the problem still shows up after you finish above procedures, please check if you install that extension for PHP CLI. You know there are different php.ini files for PHP and PHP CLI sometimes.
what worked for me was deleting the composer.lock file, then do a composer install.
edit: I also deleted the vendor directory