Join Bernard Pineda for an in-depth discussion in this video Set up your local environment: Windows, part of Learning Symfony 3.
- [Instructor] Now we are going to install our environment in Windows and see some differences that we might encounter compared to other environments, such as Mac or Linux. I'll be using Visual Studio Code throughout the course, but feel free to use the IDE of your choice. So, the first thing we will do is download and install XAMPP for Windows. So, let's open up a browser and look for XAMPP for Windows and we'll click on the first choice, Download XAMPP, and we're going to download the latest version.
I've gone ahead and downloaded them already, so I'm going to go to my Downloads folder and click on the XAMPP Installer. We're going to go ahead and uncheck FileZilla, Mercury, Tomcat, Perl, Webalizer and Fake Sendmail because we're not going to need them.
So, let's finish our installation and start the Control Panel and we're going to start MySQL. We don't need to start Apache as we won't be using it in this course. We'll be adding the MySQL and PHP Executables to the path so we can execute them from anywhere. We'll do that by running Windows R, control and in the Control Panel we'll search for variables and we're going to choose Edit the System Environment Variables.
We're going to change this and we're going to go to System Variables and look for the path variable, double click and we're going to add the following, C:\xampp\php, C:\xampp\mysqlbin. Click OK, OK and now let's change the user root password. We'll do that by running Windows R, CMD and we'll run the following command, mysql, admin, minus U, root password, root and we've set up the new password for root.
Now, now let's go to our Resources folder and let's open our Windows installation file. We'll do that in Visual Studio. We'll just drag it and let's copy this URL. Let's go to the browser, open up a new one, paste, and we'll copy this, with control A we select everything, control C to copy, let's go back to Visual Studio, and let's create a new file with File, New File.
That space here and we'll save it as the following, Save As, and we'll be saving it in the Windows XAMPP folder. We'll be typing quotes and inside the quotes we'll be typing cacert.pem.
Save. Be sure to have the quotation marks between the name so it will not save the file as a txt file. Now let's go edit the PHP configuration file. Let's go to our file browser, let's go to C, XAMPP and we'll go to PHP and the file is named php.anyfile. Let's edit it, let's drag it and we're going to search for the following, find cainfo.
Now that we found it, let's remove the semicolon at the beginning of the line and let's add the following between quotation marks, C back slash xampp, back slash, cacert.pem.
We'll save that file. Now let's install Git for Windows. So, let's open up the browser again and look for Git for Windows, and we'll click on the Git Downloads and we'll download Git for Windows. Since I've already downloaded it I'm just going to run it. Install Git.
Now let's install Composer. Composer installer. Composer is a library handler for PHP. So, we'll be downloading this one, Composer Setup, so let's go back to my downloads directory and install Composer. And just one last tip for Windows users.
Sometimes you will get some errors while trying to clear cache because of permissions, so in that case we'll need to delete the cache folder manually. We'll do this by entering the exercise files and in the var folder we'll see a cache folder. We'll delete that manually. And we're ready to go.
- Installing Symfony
- Setting up the local environment
- Exploring the Symfony file structure
- Creating routes
- Sending parameters to a controller
- Using views
- Updating routes
- Creating templates with Twig
- Data modeling with Symfony
- Demo application deployment