Symfony project Installation - symfony

I am trying to install Symfony inside my project folder by using this command: composer create-project symfony/framework-standard-edition path/ "2.5.*".
During the set up I get prompted with a question if I want to install Aceme demo bundle which I reply to with yes, the installation continues but I get prompted again with these questions "look at the image":
As you can see I filled in all the details but this throws set of errors:
[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: date_default_timezone_get(): It is not safe to rely on the system's
timezone settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those methods
and you are still getting this warning, you most likely misspelled the timezone
identifier. We selected the timezone 'UTC' for now, but please set date.timezone
to select your timezone. in
/Applications/MAMP/htdocs/Symfony/Project1/vendor/monolog/monolog/src/Monolog/Logger.php line 233
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. `
What am I doing wrong here?

Perhaps a downside of using composer to create the project, you don't have a chance to go through the "Checking your System Configuration" section of the installation and fix errors before proceeding.
https://github.com/symfony/symfony-standard/tree/2.5#2-checking-your-system-configuration
If you run php app/check.php you'll see that you haven't met one of the mandatory requirements, which is to explicitly setting the date.timezone value in your system's php.ini

I found the problem why the error was thrown xD
It was due to my php version I had installed on my mac (5.3)
Symfony requiers 5.5
Since I updated my version I dont see this error any more.
Thanks for yours help guys :)

Related

Doctrine 2.9.x-dev

Did somebody tried Doctrine 2.9.x-dev? I am using with symfony 5.2.6. I know it is a dev version but when run any command I get an error for example:
[critical] Error thrown while running command "'doctrine:schema:create'". Message: "An option named "em" already exists."
and when I run only bin/console i get error
[critical] An error occurred while using the console. Message: "An option named "em" already exists."
An option named "em" already exists.
It is because this is dev version (2.8.4 is working) or am I missing something?
The error comes from doctrine/doctrine-bundle - it seems like it is not compatible with doctrine/orm 2.9.x-dev yet.
The problem is already being worked on, but the PR has not been merged yet, see: https://github.com/doctrine/DoctrineBundle/pull/1327
If you really need the dev version to work with Symfony right now, you will need to apply the changes manually, but I would recommend waiting for a stable release.

symfony 2.8 debug fatal error double message

Environment: Symfony 2.8.1 with XAMPP Version 5.5.24 on Windows 7.
If I trigger a fatal error in a controller, anything as simple as $array = ; in production environment, I'm getting a default php error:
Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\tgsupport-test\src\AppBundle\Controller\DefaultController.php on line 16
followed by symfony custom error page message. Obviously I'd want to avoid to show eorr info in production.
Moreover in prod.log I see a double critical error: under php.CRITICAL and request.CRITICAL. Is really useful to show the same error twice?
I'm using default configuration, indeed I just installed default framework without any custom setting and I triggered my error in AppBundle/DefaultController, so I was wondering if I'm missing anything.
I missed a php.ini configuration to avoid to display error messages in page.

Failure installing sbt: "Server access Error: java.security.cert.CertificateException:"

When I try to install error messages, it fails to download. I get error messages like this:
[error] Server access Error: java.security.cert.CertificateException: No subject alternative DNS name matching repo.scala-sbt.org found. url=https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.sbt/sbt-pgp/scala_2.10/sbt_0.13/0.8.3/ivys/ivy.xml
I can confirm, when accessing via my browser, that the certificate installed for the domain repo.scala-sbt.org is actually the certificate for repo.typesafe.com, and this seems to be the source of the error. It doesn't appear to be a DNS issue as http://repo.scala-sbt.org/ (insecure) works.
Please see https://github.com/sbt/sbt/issues/2125 for the workarounds. Specifically "http" should not be used.
resolvers += Resolver.url("fix-sbt-plugin-releases", url("https://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
Edit: This issue is now resolved. No workarounds should be required.
As a temporary workaround, add the file ~/.sbt/0.13/plugins/temp.sbt with the following contents:
resolvers += Resolver.url("fix-sbt-plugin-releases", url("https://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)
You'll still see the error, but sbt will be able to find the dependency for which it is searching when accessing https://dl.bintray.com/sbt/sbt-plugin-releases directly (the place to which repo.scala-sbt.org presently redirects).
Upgrading nss package on CentOS worked for me.
sudo yum upgrade nss

Symfony production environment throws 500 error: Doctrine\ORM\ORMException 'Unknown Entity namespace alias 'DSBlogBundle'

I'm learning Symfony2, really cool stuff. But I do run into some trouble when I want to try and visit the production environment. I have followed the Symblog Tutorial that is located here: http://tutorial.symblog.co.uk/
I have cleared the cache and I visit http://symfony.dev/ I have running locally. The page remains totally blank and this error is in the log:
Fatal error: Uncaught exception 'Doctrine\ORM\ORMException' with message 'Unknown Entity namespace alias 'DSBlogBundle'.'
in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:236
Stack trace:
#0 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Configuration.php(194): Doctrine\ORM\ORMException::unknownEntityNamespace('DSBlogBundle')
#1 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(554): Doctrine\ORM\Configuration->getEntityNamespace('DSBlogBundle')
#2 /Applications/MAMP/htdocs/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(194): Doctrine\ORM\Mapping\ClassMetadataFactory->getFqcnFromAlias('DSBlogBundle', 'Blog')
#3 /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(295): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor('DSBlogBundle:Bl...')
#4 /Applications/MAMP/htdocs/symfony/vendor in /Applications/MAMP/htdocs/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php on line 236
What I don't get is that the 'Unknown Entity namespace alias 'DSBlogBundle' is perfectly "known" in the development environment. Does anyone know what I am missing? Any help is much appreciated! Thank you!
Couple possibilities I can think of:
1) If your code functions properly in the development environment, then it could be a cache problem and/or a permissions problem. Make sure your files are readable by the user/process associated with your web server and make sure the prod cache directory is writable by that user so it can generate the necessary files. What I generally do is run the clear cache console command AS that user to avoid unexpected cache problems, like this (on linux):
sudo -u www-user php app/console cache:clear --env=prod
If you're developing on linux, you must be logged in as either root or another user with administrator privileges to run a command as a user other than yourself.
2) You may have configurations defined in the dev environment that don't exist in the prod environment. Double check the files in your app/config folder. My first guess would have been that the DSBlogBundle wasn't correctly defined in app/AppKernel.php but I believe that's environment independent so it couldn't work in dev but not prod.

Apache Karaf 2.2.3, featuresBoot issue

Karaf 2.2.3 recently released and finally has a pre-bundled spring-jms feature. In order to make life easy I added it to the featuresBoot config property with the other defaults:
featuresBoot=config,ssh,management,spring-jms
However, when I start Karaf it behaves uncontrollably. Sometimes it will install on boot and other times it doesn't. When it doesn't auto-install I attempt to add it via the command line:
features:install spring-jms
And even that behaves wildly. See below:
karaf#root> features:install spring-jms
Error executing command: java.lang.IllegalArgumentException
karaf#root> features:install spring-jms
Error executing command: invalid entry size (expected 3293 but got 16823 bytes)
karaf#root> features:install spring-jms
Error executing command: Manifest not present in the first entry of the zip mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/1.0_5
karaf#root> features:install spring-jms
Refreshing bundles org.springframework.context.support (50)
Error executing command: Could not start bundle mvn:org.eclipse.jetty/jetty-client/7.4.5.v20110725 in feature(s) jetty-7.4.5.v20110725: Unresolved constraint in bundle org.eclipse.jetty.client [83]: Unable to resolve 83.0: missing requirement [83.0] package; (&(package=org.eclipse.jetty.http)(version>=7.4.0)(!(version>=8.0.0)))
karaf#root> features:install spring-jms
Refreshing bundles org.springframework.context.support (50)
Those are back-to-back executions of the install command. The last execution works.
Anyone else see this behavior? Or know how to correct it?
Tony,
First, make sure that you are using the correct version Java, I use jdk 1.6_24. When using this, with no other bundles installed (a fresh installation), it installs properly. If I were you I would:
1) try installing a fresh instance of Karaf,
2) copy your maven repository to a new location, and
3) run Karaf in a fresh installation,
4) install spring-jms again.
If that doesn't work, reply to this and let me know your environment, along with all of the exceptions generated in your karaf log file.
By any chance are you using a customized org.ops4j.pax.url.mvn.cfg? I am, and it has caused a huge boot-time race condition problem that led to features sporadically failing to load.
Take a look at https://issues.apache.org/jira/browse/KARAF-910 "Race between FeatureService and ConfigAdmin for resolving mvn: URLs?"

Resources