Symfony生产阶段不起作用

Joh*_*nes 3 symfony1

我有一个名为content的模块,它在app前端.当我去的时候 localhost:8080/frontend_dev.php/content ,我看到页面显示没问题.但没有 /frontend_dev.php 我无法访问该页面.

有什么不对?这是我的前端settings.yml:

prod:
  .settings:
    no_script_name:         true
    logging_enabled:        false

dev:
  .settings:
    error_reporting:        
    web_debug:              true
    cache:                  false
    no_script_name:         false
    etag:                   false

test:
  .settings:
    error_reporting:        
    cache:                  false
    web_debug:              false
    no_script_name:         false
    etag:                   false

all:
  .settings:
    # Form security secret (CSRF protection)
    csrf_secret:            ecca0f5ffb475363f798d55871546583f60f971f

    # Output escaping settings
    escaping_strategy:      true
    escaping_method:        ESC_SPECIALCHARS

    # Enable the database manager
    use_database:           true


    enable_modules: [default, sfGuardAuth]

我得到的是来自Web服务器的404.清除了symfony缓存,没有用.并做了一个chown -R用户名projectdirectory.

我的意思是 localhost:8080/module/action ,对任何事情都不起作用.但它在我运行symfony项目的另一台服务器上的工作方式与此类似.

编辑:我还是symfony的新手.我设法进入 localhost:8080/index.php/module/action .但是如何从路由规则中删除index.php?谢谢

谢谢

pro*_*son 6

这听起来好像没有mod_rewrite被激发,你启用它吗?它甚至安装了吗?

您可以查看:

/your/path/to/httpd -M | grep rewrite

或者你可以删除<IfModule mod_rewrite.c></IfModule>重写规则周围的标签.htaccess.执行此操作后,如果未安装和/或启用mod_rewrite,则会生成配置错误.

如果你安装了mod重写,那么确保可以使用它的指令.htaccess你应该在你的vhost(或httpd.conf)中有类似的东西:

<Directory "/path/to/your/project/web">
  AllowOverride All
  # possibly other rules....
 </Directory>
Run Code Online (Sandbox Code Playgroud)