Symfomy skeleton with Sonata
Spanish/Español: Documentación en español en README.es.md
First, you need to install composer link
-
Symfony Skeleton
composer create-project neomede/symfony-skeleton <yourProyect/> dev-symfony
-
Symfony Skeleton + Sonata Admin Bundle
composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-admin
-
Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle
composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-user
-
Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle + Sonata Media Bundle
composer create-project neomede/symfony-skeleton <yourProyect/> dev-sonata-media
-
Symfony Skeleton + Sonata Admin Bundle + Sonata User Bundle + Sonata Media Bundle + FOS Rest Bundle + JMS Serializer Bundle
composer create-project neomede/symfony-skeleton <tuProyecto/> dev-fos-rest
Run the following command to make sure that your system meets all the technical requirements:
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:
localhost\YourProjectRoute\web\config.php
After configure your project you should remove this file.
The app/cache and app/logs must be writable both by the web server and the command line user.
You need to ensure that the web server have the correct permissions. If you have problems with this, you can run the following commands:
- 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
- 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
If they are not already created, you need to add specific folder to allow uploads from users:
mkdir web/uploads
mkdir web/uploads/media
chmod -R 0777 web/uploads
To serve uploaded files you can create a virtual host:
-
Edit /etc/hosts and add a new hostname (static.vhost.dev):
127.0.0.1 localhost static.vhost.dev
-
Add new site (statics) in sites-avaliable:
server { listen 8080 ; server_name static.vhost.dev; location / { root your_project_directory/web/uploads; } }
-
Create a new symbolic link to the new file in sites-enabled.
-
In app/config/config.yml edit the following lines:
cdn: server: path: http://static.vhost.dev:8080/media
To create database we use the following command:
php app/console doctrine:database:create
php app/console doctrine:schema:update --force
To create the superuser:
php app/console fos:user:create admin --super-admin