douduoting8408 2017-07-13 15:17
浏览 43

在localhost上创建新的symfony项目

Hello I'm trying to run project using newest symfony on my localhost.

What i already did:

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 in my hosts file in Windows\System32...

127.0.0.1 Anka

This is what i see after typing

 anka\

In my browser. My localhost website

And when i click on web i see this: web

Can somebody help me what else i should do to see normal Symfony index page?

  • 写回答

2条回答 默认 最新

  • du8442 2017-07-13 23:40
    关注

    Try http://anka/app_dev.php or http://anka/web/app_dev.php

    Also You can Change the directory to this one with the application and run:

    php bin/console server:run

    Then access http://localhost:8000/ in your browser

    Like this:

    https://symfony.com/doc/current/setup.html#running-the-symfony-application

    评论
  • dtnqbre7980007 2017-07-14 00:30
    关注

    First of all - ServerName value is case-sensitive, to Apache is not really recognizing request as this VirtualHost and you're getting listing of root directory.

    Use http://Anka url, or change ServerName Anka to ServerName anka and 127.0.0.1 Anka into 127.0.0.1 anka.

    Next thing is that you have some errors in your code and PHP cannot find AnkaBundle\AnkaBundle class. You're probably missing an autoloader, but that's only my guess. Not enough information to be sure.

    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部