Giter Club home page Giter Club logo

sf2-tutorial's Introduction

sf2-tutorial

Symfony2 tutorial application based on the ZF2 tutorial by Rob Allen (see https://github.com/akrabat/zf2-tutorial)

Install

Note: All commands are given for linux, specifically tested on Ubuntu.

Composer does not work very well with Symfony, so do not use it. That's why vendor directory is included in the repository.

###Apache config: Create the following virtual host entry (place it into a file named sf2tutorial.conf in /etc/apache2/sites-available):

<VirtualHost *:80>
    ServerName sf2-tutorial.localhost
    DocumentRoot /path/to/sf2-tutorial/web
    <Directory /path/to/sf2-tutorial/web>
        AllowOverride All
        
        # apache 2.2 style
        #Order allow,deny
        #Allow from all
        
        # apache 2.4 style
        Require all granted
    </Directory>
</VirtualHost>

Of course you need to change /path/to with the real path of your project! Then enable the vhost with the following commands:

sudo a2ensite sf2tutorial
sudo service apache2 reload

Don't forget to add sf2-tutorial.localhost in your /etc/hosts file.

###Permissions Symfony needs to write to app/logs and app/cache (easy to understand why) in 2 ways:

  • from web server
  • from console utility

So you need to set premissions properly on the folders app/cache and app/logs. The best way is to use ACLs. Example for linux systems (Ubuntu):

sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

Browse this page to check the config: http://sf2-tutorial.localhost/config.php

###Database Create a mysql database named sf2tutorial and add a user sf2tuto with password sf2tuto. Then run the following command to create the schema:

php app/console doctrine:schema:update --force

###Test your app Browse to http://sf2-tutorial.localhost/app_dev.php/album

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.