Symfony
Development | GitHub | Ux Ui | DataBase | Symfony | JavaScript | AJAX | CLI |
Workstation | CentOS 7 | CentOS 8 | PHP 7.4 | Deploy | Work | Testing |
Installation
Upgrades
I have just done an upgrade from PHP 7.2 to 7.4.
Now I need to make sure as much of my Symfony development area is up to date as possible. I am running PHP 7.4.11, so in my composer.json file I changed one of the first lines from
"php": "^7.1.3",
to
"php": "^7.4.11",
Then in the development directory, I ran
./composer.phar update You are running Composer with SSL/TLS protection disabled.
Was the first message back, I really should turn SSL/TLS back on, I have not because I had issues with a package that would not download with SSL/TLS enabled.
Symfony 5
Composer
It is ways good to get the installation code from https://getcomposer.org/download/
First, make sure you are on PHP 7.4
php -v PHP 7.4.11 (cli) (built: Sep 29 2020 10:17:06) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies
Run the lines that look like:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '795f976fe0ebd8b75f26a6dd68f78fd3453ce79f32ecb33e7fd087d39bfeb978342fb73ac986cd4f54edd0dc902601dc') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
At the end you should have a single file:
rwxr-xr-x 1 name name 1994202 Oct 6 14:45 composer.phar
Symfony 5
composer create-project symfony/website-skeleton my_project_name
This does quite a lot, check that there are no errors.
mv my_project_name/* . rm -fr my_project_name
You should be left with:
-rw-rw-r-- 1 name name 13 Oct 6 14:41 ABOUT.md -rw-rw-r-- 1 name name 0 Oct 6 14:41 ABOUT.md~ drwxrwxr-x 2 name name 36 Oct 6 14:47 bin -rw-rw-r-- 1 name name 2931 Oct 6 14:47 composer.json -rw-rw-r-- 1 name name 251457 Oct 6 14:47 composer.lock -rwxr-xr-x 1 name name 1994202 Oct 6 14:45 composer.phar drwxrwxr-x 4 name name 114 Oct 6 14:47 config -rw-rw-r-- 1 name name 11 Oct 6 14:33 INSTALL.md -rw-rw-r-- 1 name name 0 Oct 6 14:33 INSTALL.md~ drwxrwxr-x 2 name name 24 Oct 6 14:47 migrations -rw-rw-r-- 1 name name 1065 Oct 6 14:47 phpunit.xml.dist drwxrwxr-x 2 name name 23 Oct 6 14:47 public -rw-rw-r-- 1 name name 32 Oct 6 14:31 README.md drwxrwxr-x 5 name name 74 Oct 6 14:47 src -rw-rw-r-- 1 name name 13304 Oct 6 14:47 symfony.lock drwxrwxr-x 2 name name 28 Oct 6 14:47 templates drwxrwxr-x 2 name name 27 Oct 6 14:47 tests drwxrwxr-x 2 name name 24 Oct 6 14:47 translations drwxrwxrwx 4 name name 30 Oct 6 14:47 var drwxrwxr-x 17 name name 251 Oct 6 14:47 vendor
Run Console
symfony server:start
We do not run encryption in development.
[OK] Web server listening The Web server is using PHP FPM 7.4.11 http://127.0.0.1:8000
And at http://127.0.0.1:8000 we see
Controllers
symfony console make:controller AuthenticationController
PHP 7.4
Git Hub
Catcha
https://github.com/Gregwar/CaptchaBundle