• Wir genießen das Vertrauen von:

How to create a development environment?

By Februar 13, 2014 Keine Kommentare

Lesson 2 from „Learn symfony 2.4 tutorial“ : Creating a development environment

Now we have a fresh symfony2 app. If not, please read the first tutorial about how to install symfony2.4.

We can access the symfony2.4 application on http://localhost/path_to_sf_project/web/app_dev.php. But the name is not so cool, right ?

We will learn in this tutorial how to create a local domain like  http://innobyte.dev (you can choose any domain you want).

** Note : This instructions are specific to Apache (We should create a tutorial example for nginx too ?) and assume you have already installed Apache and running on your machine.

Step 1.First, we need to create a new file (we need sudo privileges)

Step 2. Edit the file created (/etc/apache2/sites-available/innobyte.dev.conf) with your favorite ide and add :

**Note : Change the  path_to_sf_project with your path folder to symfony project

If you want to read more about apache vhosts, you can read here.

Step 3. Activate your new local domain

Step 4. Add a new domain to the bottom of the host file (/etc/hosts) – you need edit this with sudo too.

Step 5. Reload the apache service to get the new configuration

Step 6. edit the /var/www/path_to_sf_project/web/.htaccess file

Change app.php to app_dev.php (to use dev environment – make sure you change all occurrences of app to app_dev, should be 4 changes)

Now we can go to http://innobyte.dev. Easy, right ?

Kommentar hinterlassen