Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony1 产品环境主页上的Symfony 1.4错误400(不在开发环境中)_Symfony1_Symfony 1.4 - Fatal编程技术网

Symfony1 产品环境主页上的Symfony 1.4错误400(不在开发环境中)

Symfony1 产品环境主页上的Symfony 1.4错误400(不在开发环境中),symfony1,symfony-1.4,Symfony1,Symfony 1.4,我已经在我的计算机上测试了一个应用程序,一切正常(我通过frontend_dev.php页面只使用了开发环境) 在测试服务器上部署此应用程序时,出现以下错误400错误请求: 错误的请求 您的浏览器发送了此服务器无法理解的请求 我使用正常的URL访问了该网站。 我正在使用Symfony1.4和doctrine(不涉及其他插件)、WAMP2(PHP5.3、Apache2.0.59) 如果我尝试使用dev环境访问应用程序,它会工作。尝试检查应用程序setting.yml文件上的no\u script属

我已经在我的计算机上测试了一个应用程序,一切正常(我通过frontend_dev.php页面只使用了开发环境)

在测试服务器上部署此应用程序时,出现以下错误400错误请求:

错误的请求

您的浏览器发送了此服务器无法理解的请求

我使用正常的URL访问了该网站。 我正在使用Symfony1.4和doctrine(不涉及其他插件)、WAMP2(PHP5.3、Apache2.0.59)


如果我尝试使用dev环境访问应用程序,它会工作。

尝试检查应用程序
setting.yml
文件上的
no\u script
属性。如果应该设置为False,请清除缓存并重试

非常感谢Guiman。你引导我找到了答案

no\u script\u name
属性不是问题的根源。取而代之的是,我的
.htaccess
位于生成错误的web目录中(我向我的宠物发誓,我以前从未编辑过此文件)。下面是symfony生成的文件(粗体属性在代码1中不起作用,请看最后一行):

Options+FollowSymLinks+ExecCGI
重新启动发动机
#如果遇到问题,请取消对以下行的注释
#无法使用脚本名称
#重写基/
#我们跳过了所有的文件
#重写条件%{REQUEST_URI}\+$
#重写条件%{REQUEST\u URI}!\。html$
#重写规则。*-[L]
#我们检查.html版本是否在这里(缓存)
重写规则^$index.html[QSA]
重写规则^([^.]+)$$1.html[QSA]
重写cond%{REQUEST_FILENAME}-F
#不,所以我们重定向到前端web控制器
重写规则^(.*)$index.php[QSA,L]
这是更新后的一行(再次查看最后一行):

Options+FollowSymLinks+ExecCGI
重新启动发动机
#如果遇到问题,请取消对以下行的注释
#无法使用脚本名称
#重写基/
#我们跳过了所有的文件
#重写条件%{REQUEST_URI}\+$
#重写条件%{REQUEST\u URI}!\。html$
#重写规则。*-[L]
#我们检查.html版本是否在这里(缓存)
重写规则^$index.html[QSA]
重写规则^([^.]+)$$1.html[QSA]
重写cond%{REQUEST_FILENAME}-F
#不,所以我们重定向到前端web控制器
重写规则^(.*)$**/myApp/index.php**[QSA,L]

我不知道发生了什么,但我会在symfony网站上查看,我也有类似的问题。

这是我的第二个方法:p,很高兴知道你自己能解决它!干杯如果“不,剧本,名字”不是问题,那你为什么接受另一个答案,说这是问题?
Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
Options +FollowSymLinks +ExecCGI

<IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ **/myApp/index.php** [QSA,L]
</IfModule>