Error: Undefined class constant 'END_OF_MAINTENANCE' Symfony 2 - php

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

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.

Symfony2, getting error on running composer update

Composer.json
{
"name": "go-get-me",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"require": {
"php": ">=5.5.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",
"friendsofsymfony/user-bundle": "~2.0#dev",
"sylius/flow-bundle": "^0.15.0",
"hwi/oauth-bundle": "^0.4.1",
"stripe/stripe-php": "^3.14",
"misd/phone-number-bundle": "^1.1",
"twig/extensions": "^1.3",
"php-http/guzzle6-adapter": "^1",
"payum/payum-bundle": "^2.1#dev",
"payum/paypal-express-checkout-nvp": "^1.3.3",
"pimax/fb-messenger-php": "dev-master",
"twilio/sdk": "^4.10",
"vresh/twilio-bundle": "^1.0",
"infusionsoft/php-sdk": "^1.2",
"hayageek/oauth2-yahoo": "^2.0",
"glifery/entity-hidden-type-bundle": "^1.2"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7",
"doctrine/doctrine-fixtures-bundle": "^2.3",
"faisalman/simple-excel-php" : "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",
"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"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.5.9"
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
I am a newbie in symfony2. Here I am updating the required dependencies, Its shows an error, I am confused, do I need to take the clone of payum bundle or not? if yes then what must be the path? As My current path is /e/xampp/htdocs/nitu.dhaka/2016/subscription.
1/ Your problem one is that you required development a version of your libraries.
"payum/payum-bundle": "^2.1#dev",
You can lower your minimum-stability to dev, but you can have some unexpected behaviour since you will potentially accept to install some unstable versions of all packages. If you want still process add this line to your composer.json
"minimum-stability": "stable",
Please refer to https://getcomposer.org/doc/04-schema.md#minimum-stability for more information.
However, my advice is to use a non dev version of your packages, for example:
"payum/payum-bundle": "^2.1#dev",
could become
"payum/payum-bundle": "~2.1",
2/ A library of php is missing for some of your packages requires ext-intl *. In order to install it, please refer to https://stackoverflow.com/a/26308767/2377164
Ohh Finally Installation started, Following changed I have done:-
1. Configured ext-intl package by uncomment it from php.ini, that is in xampp/php/
2.And very important replace
payum/payum-bundle": "^2.1#dev", to "payum/payum-bundle": "^2.0",
"payum/paypal-express-checkout-nvp": "^1.3",
I thing there is a combination for
"payum/payum-bundle": "^2.0",
"payum/paypal-express-checkout-nvp": "^1.3",
This worked for me.
Thanks.

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"

Symfony 2 web directory rename

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)

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