Reputation: 819
I'm new to Symfony2 and I'm trying to create a new project in my local environment following the steps listed in the Symfony book:
Download
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install
Create Project (path relative to /var/www/)
$ php composer.phar create-project symfony/framework-standard-edition grupo76/final/ Symfony 2.5.*
1st Problem: I have to add /web/ to paths
So, now I have to test the configuration by hitting
http://localhost/grupo_76/final/config.php
I get a 404, and have to change the address to
http://localhost/grupo_76/final/web/config.php
It complains about permissions on /app/logs and /app/cache but that's ok. I ran
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 -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
2nd Problem: app_dev.php is completely broken
Then, the book suggest I should hit
http://localhost/grupo_76/final/app_dev.php
but, again, I need to add /web/
http://localhost/grupo_76/final/web/app_dev.php
The page renders, but full of errors like this No route found for "GET /"
Please, see attachment.
I'm running:
Upvotes: 0
Views: 566
Reputation: 454
A virtual-host won't help you, I already tried that, my working solution is:
1- Delete the old Symfony installation
2- Install a fresh one as root (sudo su
)
3- Grant permissions to /var/www/html
with chmod 777 -R /var/www/html
"
Just take in count that you may want to readjust the folder's permissions when you get it working, to your specific scenario.
Upvotes: 0
Reputation: 4161
You have to configure a web server. There is an official documentation for configuring web server for both Apache and Nginx. What you are doing is accessing app_dev.php
or config.php
from your localhost host relatively. See: http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
You have to define routing for your / path (homepage, in other words). See: http://symfony.com/doc/current/book/routing.html
Upvotes: 1