使用symfony“这个网站不可用”

时间:2012-03-31 18:00:23

标签: symfony wampserver

我在这台计算机上有一个本地主机,其“本地域”为:mywebsite.loc。我正在运行的服务器是wamp服务器2.2D并且工作正常..

我刚刚开始使用symfony所以也许我错过了某个地方......

我从他们的网站下载了symfony standard (without vendors)包。然后我解压缩了存档并将文件移动到我的项目文件夹..

由于我下载了没有任何供应商的版本,我必须安装它们。因此,从命令行运行:php bin/vendors install并且所有标准供应商都安装完好,没有错误..

正如检查本地服务器是否已正确配备来处理apache一样,我运行:php app/check.php,其中包含以下内容:

********************************
*                              *
*  Symfony requirements check  *
*                              *
********************************

php.ini used by PHP: C:\wamp\bin\php\php5.3.10\php.ini

** WARNING **
*  The PHP CLI can use a different php.ini file
*  than the one used with your web server.
*  (especially on the Windows platform)
*  If this is the case, please ALSO launch this
*  utility from your web server.
** WARNING **

** Mandatory requirements **

  OK        Checking that PHP version is at least 5.3.2 (5.3.10 installed)
  OK        Checking that the "date.timezone" setting is set
  OK        Checking that app/cache/ directory is writable
  OK        Checking that the app/logs/ directory is writable
  OK        Checking that the json_encode() is available
  OK        Checking that the SQLite3 or PDO_SQLite extension is available
  OK        Checking that the session_start() is available
  OK        Checking that the ctype_alpha() is available
  OK        Checking that the token_get_all() is available
  OK        Checking that the APC version is at least 3.0.17

** Optional checks **

  OK        Checking that the PHP-XML module is installed
  OK        Checking that the token_get_all() function is available
  OK        Checking that the mb_strlen() function is available
  OK        Checking that the iconv() function is available
  OK        Checking that the utf8_decode() is available
  OK        Checking that the intl extension is available
  OK        Checking that the intl ICU version is at least 4+


[[WARNING]] Checking that a PHP accelerator is installed: FAILED
            *** Install a PHP accelerator like APC (highly recommended) ***
  OK        Checking that php.ini has short_open_tag set to off
  OK        Checking that php.ini has magic_quotes_gpc set to off
  OK        Checking that php.ini has register_globals set to off
  OK        Checking that php.ini has session.auto_start set to off

** Optional checks (Doctrine) **

  OK        Checking that PDO is installed
  OK        Checking that PDO has some drivers installed: mysql, sqlite

你可以看到一切都很好,除了没有在我的本地机器上安装PHP加速器。在我的vhosts配置文件中,我尝试使用DocumentRoot project_directory/和{{1 }}

当它被设置为标准project_directory/web/时,我在浏览器中获得了目录列表,但是当我遍历到web文件夹时,project_directory/会选择并转到app.php。< / p>

无论哪种方式,当我尝试加载app.php或app_dev.php时,我得到以下内容:

  

此网页不可用与mywebsite.loc的连接是   中断。

而且我不知道如何解决这个问题......我能得到的任何帮助都会很棒......我会尝试任何事情让它运转起来..

[编辑]

.htaccess

[EDIT1]

[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest". [] []
[2012-03-31 19:32:54] request.INFO: Matched route "_welcome" (parameters: "_controller": "Acme\DemoBundle\Controller\WelcomeController::indexAction", "_route": "_welcome") [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
[2012-03-31 19:32:54] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []

[EDIT2]

在httpd.conf中我添加了:

[Sat Mar 31 11:54:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://mywebsite.loc/
[Sat Mar 31 11:54:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://mywebsite.loc/
[Sat Mar 31 11:54:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://mywebsite.loc/
[Sat Mar 31 11:54:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://mywebsite.loc/
[Sat Mar 31 11:54:51 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Apache2, referer: http://mywebsite.loc/

适用于我所有其他网站(不使用symfony)

我的vhost看起来像:

<Directory "G:/websites/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>

某处,无论是服务器还是其他人试图读取的C:/ Apache2都不存在..但我找不到它的位置..所以我创建了文件夹并复制了整个apache文件夹它..

但是我在日志中得到的是:

<VirtualHost *:80>
    DocumentRoot "G:/websites/my websites/mywebsite/web/"
    ServerName mywebsite.loc
    ServerAlias www.mywebsite.loc
    ErrorLog "logs/mywebsite.loc-error.log"
    CustomLog "logs/mywebsite.loc-access.log" common
<Directory "G:/websites/my websites/mywebsite/web/">
    Options Indexes FollowSymLinks
        AllowOverride all
        Order Allow,Deny
        Allow from all
</Directory>

4 个答案:

答案 0 :(得分:0)

它应该使用app_dev.php。将虚拟主机DocumentRoot设置为project_directory / web

如果不能正常工作,我建议检查app / cache和app / logs的权限。两个文件夹必须可供Apache用户写入。看一下Book页面:

http://symfony.com/doc/current/book/installation.html#configuration-and-setup

如果权限正确且仍然无效,请检查app / logs / dev.log和Apache日志。

修改

可能是虚拟主机配置错误:

更改此

<Directory /path/to/web/root >
Options IndexesFollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>

到这个

<Directory /path/to/web/root >
Options IndexesFollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
</Directory>

来源:http://kurinchilamp.kurinchilion.com/2010/04/apache-client-denied-by-server-configuration-error.html

答案 1 :(得分:0)

不确定原因,但我们今天花了几个小时。安装较旧版本的wamp(2.1)有效。

答案 2 :(得分:0)

完全抛弃wamp并逐个安装每个组件就行了......不确定为什么它不适用于wamp ...

答案 3 :(得分:0)

在父类中定义addChild()方法后,我遇到了同样的问题。这种方法与同一种儿童方法不相容。

我不知道为什么,调试器不能完成它的工作,我有同样的连接被拒绝/这个网站不可用,等等。

我只需撤消我的更改并且效果很好。