Symfony 2 web directory rename - php

I have a Symfony 2 project and I cant rename the web dir for some reasons. I am trying to rename it to public.
According to the manual, I am suppose to change the composer.json and make sure the links in app.php and app_dev.php is correct.
But when I run app/console server:run, it shows
The given document root directory "C:/xampp/htdocs/xxx/app/../web" does nto exists.
I have changed the composer.json, run composer install and composer update but still no luck. Here is my composer.json , as you can see I have already added "symfony-web-dir": "public" to the file.
If I rename my public folder to web, then everything is fine, but for certain reasons I can't do that.
{
"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"
}
}
}

You can indeed change the name of the 'web' directory, but the server:run command does not expect this. As you can see in the ServerRunCommand source code (on line 77), the 'web' directory is hard-coded in there.
However, you should be able to solve this by simply providing the --docroot option when running the command:
bin/console server:run --docroot=C:/xampp/htdocs/xxx/public
(replace bin/console with the location of the console, which may be app/console if you are using the Symfony 2 structure)

Related

Undefined class constant 'IGNORE_ON_UNINITIALIZED_REFERENCE' when updating from 3.3 to 3.4

I am currently trying to update a Symfony 3.3 to the latest Symfony 3.4 (will port it to Symfony 4 before support runs out, no time to rewrite the system though) and PHP 7. Since PHP 7.3 seems to not work that great with 3.4 I decided to stay on PHP 7.2 for now.
I updated the composer.json, ran composer install (and update with dependencies) and clearned the cache. However, after everything worked flawlessly within composer, I tried to access the system where I am greeted by the following message:
Fatal error: Uncaught Error: Undefined class constant
'IGNORE_ON_UNINITIALIZED_REFERENCE' in
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php:93
Stack trace: #0
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\Compiler.php(141):
Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass->process(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#1 E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php(788):
Symfony\Component\DependencyInjection\Compiler\Compiler->compile(Object(Symfony\Component\DependencyInjection\ContainerBuilder))
#2 E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(637):
Symfony\Component\DependencyInjection\ContainerBuilder->compile() #3
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php
in
E:\XAMPP7_2\htdocs\wsm-rando\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass.php
on line 93
Any thought how I could fix that? I am sure I have a wrong package installed or something.
Here's the composer.json for reference:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.4.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "^3.1",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"faceleg/html5lib-php": "dev-master",
"smalot/pdfparser": "*",
"seostats/seostats": "dev-master",
"nategood/httpful": "*",
"twbs/bootstrap": "*",
"friendsofsymfony/user-bundle": "2.0.*",
"phpoffice/phpspreadsheet": "^1.1",
"ext-json": "*"
},
"require-dev": {
"sensio/generator-bundle": "^3.0"
},
"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",
"symfony-var-dir": "var",
"symfony-bin-dir": "bin",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.5-dev"
}
}
}
I was able to fix this issue with the help of the Symfony Devs Slack group. It turned out that the constant was indeed set, however due to some faulty cache it wasn't included in the runtime.
To fix this issue, I had to manually remove the cache/prod and cache/dev folders instead of using the bin/console cache:clear command.

Symfony - upgrading an old project (v 2.6) to 3.4

I have a Symfony web app that needs to be upgraded from Symfony 2.6 to 3.4. Is there a standardized, bare bones composer.json that shows what's necessary for the current version? The demo app's file on github seems to be filled with a bunch of extra things that I'm not entirely sure I need. Ideally, I'd like to update the existing composer.json and put out backwards compatibility fires where they may pop up.
EDIT: my current composer is -
{
"license": "Private",
"type": "project",
"description": "Home/e-commerce site",
"autoload": {
"psr-0": { "": "src/", "SymfonyStandard": "app/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.6.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "2.6.*",
"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",
"jms/security-extra-bundle": "dev-master",
"jms/di-extra-bundle": "dev-master",
"friendsofsymfony/user-bundle": "2.0.*#dev",
"roave/security-advisories": "dev-master"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"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",
"keep-outdated": true
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}
Try running composer create-project symfony/framework-standard-edition - it will set up a bare bones project with the default composer.json. Here's what that looks like:
{
"name": "name",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"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",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"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": {
"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": null
}
}
Symfony's upgrade guide contains useful information on the deprecations you may encounter.
That is not so easy. So first you can setup a new project with the symfony installer.
symfony new my_project
in the example project you have the actual composer.json you can use that version. Next step is to look at all your extensions if they are the latest version. Next step is to at the upgrade guides what have changed and change all that new things and from 2.6 to 3.3 there is a lot of stuf that have changed. You can find the upgrade instructions in the repository.
https://github.com/symfony/symfony/blob/master/UPGRADE-3.0.md
for example. You have to fix all problems and change your code until it's working again.
Unless you really need to go for 3.* (PHP 7 or other reasons for which you can not choose the version), you can update to the LTS version instead:
Symfony roadmap
Currently, 2.8.22 is a long term support version. This means you need only to update from 2.6 to 2.8 and you'll be fine for some time (security and documentation wise).
For specific details you can use the version checker on the page above. It shows that 3.4 is supported for 2 years longer than 2.8, but the LTS is also perfectly fine.
Consider your specific case IF going smaller steps may be a better choice. Most changes from 2.6 to 2.8 are necessary to get to 3.4, anyways.
2.8:
Nov 2018: End of support for bug fixes
Nov 2019: End of support for security fixes
3.4:
Nov 2020: End of support for bug fixes
Nov 2021: End of support for security fixes

Symfony2 Sonata EcommerceBundle failing to install from composer

I have a new project and I want to try out sonata Ecommerce bundle. I removed all the vendors to do a clean composer install, but when I do php composer.phar install I get this error:
$ php composer.phar install
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
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.6.x-dev -> satisfiable by symfony/framework-standard-edition[2.6.x-dev].
- symfony/framework-standard-edition 2.6.x-dev requires sonata-project/ecommerce 2.3-dev -> 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.
This is my composer.json:
{
"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.6.*",
"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.12",
"sensio/framework-extra-bundle": "~3.0",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~1.3",
"sonata-project/core-bundle": "dev-master",
"sonata-project/ecommerce": "2.3#dev",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/easy-extends-bundle": "dev-master",
"sonata-project/user-bundle": "dev-master",
"sonata-project/datagrid-bundle": "dev-master",
"knplabs/knp-menu": "2.*",
"sonata-project/classification-bundle": "dev-master",
"jms/serializer-bundle": "~0.11",
"sonata-project/media-bundle": "dev-master",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"ddeboer/data-import-bundle": "dev-master",
"braincrafted/bootstrap-bundle": "dev-master",
"twitter/bootstrap": "3.3.*",
"symfony/property-access": "~2.6",
"knplabs/knp-paginator-bundle": "~2.4",
"sonata-project/translation-bundle": "~1.0"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"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",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
}
}
Even if I do
"require": {
"sonata-project/ecommerce": "2.3#dev",
},
I get the same problem... I tried, both, 2.3#dev and dev-master. It didnt help. But without this ecommerce require the composer installs without any errors.. What is wrong here?
I was able to install the dependencies by starting from a new composer.json file:
$ composer create-project symfony/framework-standard-edition "2.6" "2.6.*" --no-interaction -v
I added the "sonata-project/ecommerce": "dev-master" dependency and "minimum-stability": "dev" to the composer.json file. Then composer update worked perfectly.
Then I started adding the dependencies from your question but it failed with all the dependencies, so I think there is a compatibility problem between packages.
Here is the full composer.json file:
{
"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.6.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"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": "~4.0",
"sensio/framework-extra-bundle": "~3.0,>=3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/ecommerce": "dev-master",
"friendsofsymfony/user-bundle": "~1.3"
},
"require-dev": {
"sensio/generator-bundle": "~2.3"
},
"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",
"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::removeSymfonyStandardFiles",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"minimum-stability": "dev"
}
Edit: I was able to install the dependencies from the composer.json file from the question by:
remove the sonata-project and "knplabs/knp-menu": "2.*", requirements
add "sonata-project/ecommerce": "dev-master",
add "minimum-stability": "dev"

Error: Undefined class constant 'END_OF_MAINTENANCE' Symfony 2

I'm developing the functions of an existing project.
The project is developed using Symfony 2. And I created a virtual host Apache (Ubuntu and LAMP) to turn it. When the boot gives me this error.
"FatalErrorException in ConfigDataCollector.php line 276: Error: Undefined class constant 'END_OF_MAINTENANCE'". I can not update the composer because if I would do when I would do after "git push" to the master should also load the new libraries (packages) and does not need it because the site run well with this version of the composer.
Then another thing:
it is normal that when I delete brutally cache symfony to understand (/ project / app / cache), when after loading the page of my project, Apache is to write with your permissions on the folder so I can not do php app / console cache: clear. I wanted to know if it is a problem that affects the other or not.
One other thing the same thing that happens to / project / app / cache happens with / project / app / logs.
I am attaching the composer.
{
"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",
"friendsofsymfony/user-bundle": "~2.0#dev",
"facebook/php-sdk": "3.2.0",
"friendsofsymfony/facebook-bundle": "dev-master",
"friendsofsymfony/jsrouting-bundle": "#stable",
"mattketmo/email-checker": "~1.0",
"hwi/oauth-bundle": "0.4.*#dev",
"suncat/mobile-detect-bundle": "0.10.*"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "2.*"
},
"scripts": {
"post-install-cmd": [
"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.4-dev"
}
}
}
Thanks a lot

Error in attempting to create a bundle within symfony2

I have installed symfony2 and i have ensured the application has been installed correctly and i am trying to create a bundle for my project and i seem to be getting this message and i have edited the composer.json manually and added the correct bundle to the file:
Generating the bundle code: OK
Checking that the bundle is autoloaded: FAILED
Confirm automatic update of your Kernel [yes]? yes
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]? yes
Importing the bundle routing resource: OK
i have ensured composer has been configured correctly and i have removed previous namespaces from appkernel.php and routing.yml any help would be much appreciated.
this is my composer.json file:
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": {
"Acme": "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"
},
"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 also encountered the same problem while generating my first bundle. I did the following things:
1. Make sure you have Composer installed before generating a bundle.
2. If the same failure message occurs on generating bundles, then in the terminal type this in your project directory $ sudo composer dumpautoload -o.
This will run your application.

Categories