Issue
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:
Solution
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.
Answered By - Alvin Bunk Answer Checked By - David Goodson (WPSolving Volunteer)