What is Symfony? (https://symfony.com)
Symfony is a PHP web application framework and a set of reusable PHP components/libraries. Symfony was published as free software on October 18, 2005 and released under the MIT license.
Alternatives to Symfony are:
– Django (Python)
– Ruby on Rails (Ruby)
Let’s start!!!
WAMP INSTALLATION
1. First we need to install Apache, PHP and MySQL on our Windows Machine.
we can install them separately or installa a PHP development environment, that installs a ready to use environment. There are a lot of software for a dev PHP environment, the most popular are: WAMP XAMPP AMPPS. I will use WAMP.
a. Download WAMP at http://www.wampserver.com/en/#download-wrapper and launch the installer
b. Choose your .exe browser, I will use “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” because I love the tools for developers of this browser.
Choose yout txt editor, for me is: “C:\Program Files (x86)\Notepad++\notepad++.exe”
c. Open theWindows firewall ports
d. Config the mail() function of PHP
… or leave the default parameters
If installation succeed you will find WAMP options in the notification bar nera your clock.
The WAMP icon will be green: all services running
LMB on WAMP icon:
– Local Host
– phpMyAdmin etc…
RMB on WAMP icon:
– Wamp Settings
– tools
– exit etc…
To avoid conflicts in port 80 with Skype, open Skype> Strumenti> Opzioni> Avanzate> Connessione> uncheck ‘Usa le porte 80 e 443 per le connessioni in ingresso aggiuntive’
WAMP TEST SCRIPT
Now I will test WAMP.
– Click LMB WAMP icon> www directory
– Create here a ‘test’ folder and a test script ‘index.php’
<?php $name = "Andrew"; echo "My name is " . $name; ?>
– open the browser and digit http://localhost/test/
– You can also LMB WAMP icon> localhost, you will find under ‘Your project’ the ‘test’ folder, but you can not run with a simple click, use the browser at http://localhost/test/ to do it!!!
WAMP phpMyAdmin
– Click LMB WAMP icon> localhost under ‘Tools’ tab phpmyadmin> user ‘root’, pass leave blank
or call with browser http://localhost/phpmyadmin/
SYMFONY INSTALLATION on WAMP with COMPOSER
1. https://getcomposer.org/
2. Download> https://getcomposer.org/Composer-Setup.exe
3. Run as Administrator
4. wamp64/bin/php/php7.0.10/ php.exe
5. Win button> cmd.exe> C:\Users\HAF922\composer and composer will run
START A PROJECT
1. Go to the project folder, example symfonytest> SHIFT+RMB> ‘Apri finestra di comando qui
‘
2. Win button> cmd.exe> composer create-project symfony/framework-standard-edition first_test_symfony
You can use Copy/Paste Win standard function if you want.
3. Download and installation start.
database_host 127.0.0.1: ok is local host
database_port: 3306
database_name: symfony
database_user: root
database_password: 123
…
secret: 123456
At the end the prompt will have: C:\wamp64\www\symfonytest>cd first_test_symfony
Inside the folder will be the folder structure of my project:
– app
– bin
– src
– tests
– var
– vendor
– web
– composer.json
– LICENSE etc…
Open your broser at: http://localhost/symfonytest/first_test_symfony/web/
Grats!!!
NOTES for Bluehost users at point 3. uses settings similar to the following:
database_driver: pdo_mysql
database_host: localhost
database_port: ~
database_name: (cpanelUsername_databaseName)
database_user: (cpanelUsername_databaseUsername)
database_password: (whatever you picked)
Example:
database_driver: pdo_mysql
database_host: localhost
database_port: ~
database_user: joe1337
database_name: joe1337_sym1
database_password: eHTb7%Pxa9