2017 © Pedro Peláez
 

project symfony-skeleton

Symfony Skeleton

image

neomede/symfony-skeleton

Symfony Skeleton

  • Tuesday, August 26, 2014
  • by neomede
  • Repository
  • 3 Watchers
  • 6 Stars
  • 113 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Symfony Skeleton

Symfomy skeleton with Sonata, (*1)

Spanish/Español: Documentación en español en README.es.md, (*2)

Installation

First, you need to install composer link, (*3)

  1. Symfony Skeleton, (*4)

    composer create-project neomede/symfony-skeleton <yourProyect/> dev-symfony
    
  2. Symfony Skeleton + Sonata Admin Bundle, (*5)

    composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-admin
    
  3. Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle, (*6)

    composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-user
    
  4. Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle + Sonata Media Bundle, (*7)

    composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-media
    
  5. Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle + Sonata Media Bundle + FOS Rest Bundle + JMS Serializer Bundle, (*8)

    composer create-project neomede/symfony-skeleton <tuProyecto/> dev-fos-rest
    

Configure

Run the following command to make sure that your system meets all the technical requirements:, (*9)

php app/check.php

You need to visit the next url to check all the technical requirements in the web server and configure the symfony project:, (*10)

localhost\YourProjectRoute\web\config.php

After configure your project you should remove this file., (*11)

Errors

Cache/Logs folder permissions

The app/cache and app/logs must be writable both by the web server and the command line user., (*12)

You need to ensure that the web server have the correct permissions. If you have problems with this, you can run the following commands:, (*13)

  1. Using ACL on a system that supports chmod +a
$ rm -rf app/cache/*
$ rm -rf app/logs/*

$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
  1. Using ACL on a system that does not support chmod +a
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\  -f1`
$ sudo setfacl -Rn -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dRn -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs

Sonata Media Bundle

If they are not already created, you need to add specific folder to allow uploads from users:, (*14)

mkdir web/uploads
mkdir web/uploads/media
chmod -R 0777 web/uploads

To serve uploaded files you can create a virtual host:, (*15)

nginx

  1. Edit /etc/hosts and add a new hostname (static.vhost.dev):, (*16)

    127.0.0.1       localhost       static.vhost.dev
    
  2. Add new site (statics) in sites-avaliable:, (*17)

    server {
            listen 8080 ;
    
            server_name static.vhost.dev;
    
            location / {
                root your_project_directory/web/uploads;
            }
    }
    
  3. Create a new symbolic link to the new file in sites-enabled., (*18)

  4. In app/config/config.yml edit the following lines:, (*19)

    cdn:
        server:
            path: http://static.vhost.dev:8080/media
    

Creating Database

To create database we use the following command:, (*20)

php app/console doctrine:database:create

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

To create the superuser:, (*21)

php app/console fos:user:create admin --super-admin

The Versions