Creating a new symfony project on localhost
Hello I am trying to run a project using the latest symfony on my localhost.
What I have already done:
I added this to my vhosts file in Xampp.
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "F:\Programy\XAMP\htdocs\Anka\web"
ServerName Anka
DirectoryIndex app_dev.php
ErrorLog "logs/vark.local-error.log"
CustomLog "logs/vark.local-access.log" common
</VirtualHost>
I added this to my hosts file in Windows \ System32 ...
127.0.0.1 Anka
This is what I see after typing
anka\
In my browser. My site is localhost
And when I click web , I see the following: web
Can someone help me what else should I do to see a regular Symfony index page?
source to share
Try http://anka/app_dev.php
orhttp://anka/web/app_dev.php
Also you can change directory to this one with application and run:
php bin/console server:run
Then select http://localhost:8000/
in your browser
Like this:
https://symfony.com/doc/current/setup.html#running-the-symfony-application
source to share
First of all - the value ServerName
is case sensitive and Apache doesn't recognize the request as this VirtualHost and you get a list of the root directory.
Use http://Anka
url or change ServerName Anka
to ServerName Anka
and 127.0.0.1 Anka
to 127.0.0.1 Anka
.
Next, you have some errors in your code and PHP cannot find the class AnkaBundle\AnkaBundle
. You are probably missing the autoloader, but that's just my guess. Not enough information.
source to share