0

I have made a VirtualHost on WAMP server for my Symfony 3 project. Symfonys 3 homepage is loading well but when im going on some other route in my case on doc/login my page is loaded but without the css the page won't load the css. file, and the js. files and css. files for my other page after i login in. Can anyone help me?

httpd-vhosts.conf

<VirtualHost *:80>
    ServerName doc
    DocumentRoot "C:/Users/Tereza/my_project/web/app_dev.php"
    <Directory "C:/Users/Tereza/my_project/web">
        Options Indexes FollowSymLinks MultiViews Includes ExecCGI
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

hosts file

127.0.0.1       doc

Here is what am i getting when i go to doc/login route:

2 Answers 2

2

here is the Symfony3 Web server configuration information Link: http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html

You need to modify your DocumentRoot directive just as @RiggsFolly has indicated.

In your browser to access the DEV environment enter:

http://doc/app_dev.php

That will bring up the DEV toolbar that you are looking for. For the browser that you are using, is it on a remote host? If so, then you'll need to edit the file "web/app_dev.php" like so:

if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['192.168.0.208',
            '127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server')
) {

Where "192.168.0.208" is the IP Addres of your remote host that you want to allow remote host access to the DEV enviroment.

Sign up to request clarification or add additional context in comments.

Comments

0

DocumentRoot is not supposed to contain a PHP script.

Its supposed the be a directory only

DocumentRoot "C:/Users/Tereza/my_project/web"

3 Comments

but when i do that i can't access my route on /login im getting "500 Internal Server Error" but when i add app_dev.php im getting the route but my css and js files are not loaded. Maybe it's because all files are in my bundle where im building my app? Do you know maybe why it won't load the files? Any idea?
What URL are you using to launch the Symfony app
When i go to doc/ im getting the Symfonys homepage on screen. Im having doc/login and on login the route is going to doc/user, but i don't know why my files are not loading.

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.