I have a PHP solution which is being moved from PHP7.4 -> PHP8.1. This required updating many packages used, such as Symfony and Doctrine. Everything seems fine, but when I go to run my deployment script, which re-generates Doctrine proxy files, I encounter an error:
Fatal error: Uncaught Symfony\Component\Console\Exception\LogicException: An option named "em" already exists. in /usr/local/store/vendor/symfony/console/Input/InputDefinition.php:232
I've tried playing with the Doctrine and Symfony versions which are required (I've tried symfony/console 5.4.16 and 6.2.5, and I had to downgrade doctrine/dbal from 3.5.1 to 2.13.9 to fix a different issue in the same deployment step), but I can't find any combination of packages that solves this issue.
The deployment is running the following:
php ./vendor/bin/doctrine-module orm:generate-proxies --em=orm_databasename
Related
I've inherited a Symfony/PHP web app codebase with zero documentation. I'm a nodejs dev so you can image the fun...! Anyway I'm getting there, my focus atm is to be able to run the project locally.
Here's the Symfony version:
Symfony version 2.7.16 - app/dev/debug
I've installed packages via composer install.
I can start the web app locally via CLI:
php app/console server:run
Server running on http://127.0.0.1:8000
Quit the server with CONTROL-C.
However when I try to access this URL I'm seeing the following error in browser. Have google'd around but couldn't work it out so am hoping someone here can point me in the right direction.
I think this is due to trying to run a new version of twig on an old version of Symfony
as you can see here: https://github.com/symfony/symfony/issues/20284
They mention something similar, perhaps try to include an older version of twig in composer?
composer require twig/twig 1.23
I just updated my Laravel 5.4.23 to 5.5 and tried running my tests for PHPUnit and I am receiving the following error and I am trying to scour around the internet and find out people who have done so and have received the same error message but have not had any luck.
Has anyone received this error?
Call to undefined method Whoops\Handle\PrettyPageHandler::setApplicationPaths()
setApplicationPaths() doesn't exist in the 2.0.0 release of the filp/whoops library. Essentially, it's not a problem with Laravel 5.5 but with that specific version of Whoops. I experienced the same issue until I updated the library version I was using to the newest stable version of Whoops (2.1.10), which I did by changing the dependency version in my composer.json file "filp/whoops" : "~2.1.10" Once you make that change, run composer update and the error should go away.
(1/5/2018) Editing to add that this doesn't appear to be an issue in later releases of Laravel 5.5, so changes to the version of filp/whoops should not be necessary at this point.
Have you tried clearing all the caches via php artisan cache:clear or php artisan view:clear?
I had fresh install symfony (3.3.2) project on Debian 8, PHP 5.6, but I have issue when running web application.
PHP Fatal error: Method ReflectionMethod::__toString() must not throw an exception in /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ReflectionClassResource.php on line 0, referer:
I see this message after composer completes symfony installation and tries to clean cache, also web is not working and in error_log is this error.
Can't find solution for this problem, or it's Symfony bug?
I've encountered a strange error when installing libraries from composer.
After running 'composer install' and installing all libraries this is what I get in the terminal:
Updating the "app/config/parameters.yml" file
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to replace alias "swiftmailer.mailer.default.transport.real" with actual definition "".
Strangely on my MAC dev (mac air, homebrew php and mysql) setup I don't have this issue. However on this machine (windows 10, Yoga 900) when installing the the project from my github repo, I've had this issue.
I can't run 'php bin/console debug:container' without the error occuring again.
Versions:
Symfony 3.0.9
SwiftMailer v5.4.3
I've googled the issue and had no luck finding an answer but found related issues:
https://github.com/symfony/swiftmailer-bundle/issues/59
Error after updating symfony/swiftmailer-bundle to 2.2.5
Any help greatly appreciated, unfortunately I don't have the knowledge to solve this one.
Same issue here, my problem was that I do not set mailer_transport in parameters.yml
I successfully completed the configuration check on web/config.php when installing Symfony on a U10 LAMP server, but now running across this error when trying to run web/app_dev.php/_configurator/:
Fatal error: Interface 'Symfony\Bridge\Doctrine\RegistryInterface' not found in /var/www/symfony/vendor/symfony/src/Symfony/Bundle/DoctrineBundle/Registry.php on line 26
Did I forget to install something?
You are missing Doctrine bridge for some reason. I guess something went wrong when you installed vendors (github might have been down for a minute and it just skipped this part).
Try to reinstall vendors:
./bin/vendors install
Or just download Symfony2 with pre-installed vendors.