It’s very helpful to know which version of the Symfony framework you’re using, and so here’s a quick guide to how you find which Symfony version you’re running.
Try running each of the following at the command prompt until you get an answer. I show a sample response for each:
$ php bin/console --version
Symfony 5.1.1 (env: prod, debug: false)
$ php app/console --version
Symfony version 2.4.1 - app/dev/debug
$ php ./symfony --version
symfony version 1.4.21-punkave (/var/www/p/releases/20200504161617/lib/vendor/symfony/lib)
If your project is running on Microsoft Windows, change the /
to \
in the calls above.
Can’t run a command, or only have access to the project files? See if one of the following files exists:
vendor/symfony/http-kernel/Kernel.php
vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php
Found it? Look inside the file for a line like:
const VERSION = '5.0.4';
that’s the Symfony version number.
Did neither file exist? You may be running a much older version of Symfony. Have a look for this file:
lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php
If it exists, look inside and find the line that looks like this:
define('SYMFONY_VERSION', '1.4.21-punkave');
Use my Symfony development services and you never have to think about your Symfony version again. I've 14 years' experience programming with Symfony and I specialise in taking over existing projects.
Find out more!