2

I am a beginner into Symfony, and I'm having troubles to made it works. I'm running apache 2 on my machine (ubuntu). It seems that I can reach the configuration by the url: localhost/Symfony/web/config.php

Also, I can reach the main page by this url: localhost/Symfony/web/app_dev.php (the first I see is a message telling: An error occurred while loading the web debug toolbar (404: Not Found). Do you want to open the profiler?). The only thing I can is to respond is cancel (If y try accept, I get a 404 not found).

After that, nothing works. Even the . Always 404 not found.

As I can found, it can be a problem with the cache or maybe with apache config. But whatever I try it doesn't solve the issue (other people ask similar here in stackoverflow, but nothing fix for me).

Anybody knows? Thanks in advance.

2
  • 1
    have you given 777 permission to cache and log Commented Mar 25, 2013 at 9:37
  • suthar you just ommitted the hello character :) Commented Mar 25, 2013 at 9:39

2 Answers 2

4

I used to have this problem too, please take a look at my configurations and try them out

inside my .htaccess:

Hi all, I have been having this problem too. And it seems that the "stock" .htaccess is the problem. I have solved this in my environment and here is my .htaccess with notes:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^app_dev.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]    ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]
    RewriteRule .? %{ENV:BASE}/app_dev.php [L]        ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        # When mod_rewrite is not available, we instruct a temporary redirect of
        # the startpage to the front controller explicitly so that the website
        # and the generated links can still be used.
        RedirectMatch 302 ^/$ /app.php/
        # RedirectTemp cannot be used instead
    </IfModule>

inside my "symfony" entry in /etc/apache2/sites-available:

<VirtualHost 127.0.1.15>
    ServerAdmin webmaster@localhost
    ServerName symfony
    DocumentRoot /var/www/Symfony/web
DirectoryIndex app.php
    <Directory /var/www/Symfony/web>
        Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Sign up to request clarification or add additional context in comments.

1 Comment

For future readers, I had the issue, I was missing the "AllowOverride All" in the apache config.
0

Maby take a look at your .htaccess or your appache setting (mod_rewrite)

Look at : Symfony 404 errors

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.