【问题标题】:installing and configuring symfony 3.2安装和配置 symfony 3.2
【发布时间】:2017-01-07 20:08:03
【问题描述】:

我正在尝试安装 Symfony 3.2,我已尝试按照此处的说明进行操作:

http://symfony.com/doc/current/setup.html.

首先在运行命令时:

php.exe symfony new SymfonyProject

我得到了错误:

cURL 错误 60:SSL 证书问题:无法获取本地颁发者证书

这里有一个解决方案:

cURL error 60: SSL certificate: unable to get local issuer certificate

之后,我已经成功安装并创建了一个 Symfony 项目,尝试访问我的 apache 服务器的 http://localhost:port/config.php 时出现错误页面。

所以我前往 apache 配置页面:

http://symfony.com/doc/current/setup/web_server_configuration.html

并且更改了最低要求变量以满足我的系统(当然需要重新启动 apache 服务):

<VirtualHost *:port>
    ServerName localhost
    ServerAlias localhost

    DocumentRoot "C:\xampp\htdocs\SymfonyProject\web"
    <Directory "C:\xampp\htdocs\SymfonyProject\web">
        AllowOverride All
        Order Allow,Deny
        Allow from All
    </Directory>

    ErrorLog "C:\xampp\apache\logs\project_error.log"
    CustomLog "C:\xampp\apache\logs\project_access.log" combined
</VirtualHost>

我还将文档根目录更改为“C:\xampp\htdocs\SymfonyProject\web”并尝试了“C:\xampp\htdocs\SymfonyProject”(以防万一),但无济于事。

但我仍然收到错误

project_access.log 和 project_error.log 为空。

我尝试了除http://localhost:port/config.php之外的另一个页面

在这里:http://symfony.com/doc/current/quick_tour/the_big_picture.html

有人建议去http://localhost:port/app/example也是一个有效的页面,但我仍然得到一个错误。

非常感谢您的帮助

【问题讨论】:

  • 是的,我使用的是实际端口,但根据我在运行时的回答: php bin/console server:run 在任何情况下它默认为 8000(而不是我的端口)谢谢你的建议.

标签: php apache symfony apache-config


【解决方案1】:

对不起,我错过了一步。

running, php bin/console server:run as described here:

http://symfony.com/doc/current/setup.html

允许我访问 config.php 文件。

【讨论】:

  • 仅供参考,您可以使用编辑按钮将此类内容添加到原始问题中。
【解决方案2】:

试试这个改变:

...
NameVirtualHost *:80
...
<VirtualHost *:80>
    ServerName localhost
    ServerAlias localhost

    DocumentRoot "C:\xampp\htdocs\SymfonyProject\web"
    <Directory />
        Options Indexes FollowSymLinks MultiViews
          AllowOverride All
    </Directory>

    ErrorLog "C:\xampp\apache\logs\project_error.log"
    CustomLog "C:\xampp\apache\logs\project_access.log" combined
</VirtualHost>

确保 NameVirtualHost 未注释。另外,你为什么要访问:

http://localhost:port/config.php

我认为您将无法访问 config.php 文件。改为尝试(对于默认路由):

http://localhost/

【讨论】:

  • 可能想要查看您建议的答案,因为恕我直言,它甚至还没有接近。
  • @Cerad ,这是从我实际工作的 apache 配置中剪切和粘贴的(大致)。我现在仔细检查了一下,还是一样。另外,我使用 Symfony 生成的默认 .htaccess。我不确定您所说的“甚至不接近”是什么意思?见my link on it
  • 可能这里的重点工作大致上。 不会做任何事情。您缺少 Require local。并且缺少目录路径。细节很重要。并且无法访问 config.php 的问题几乎让您看起来好像没有实际安装 Symfony 应用程序?
猜你喜欢
  • 1970-01-01
  • 2019-10-21
  • 2021-02-12
  • 2023-03-14
  • 1970-01-01
  • 2016-08-24
  • 1970-01-01
  • 2023-03-20
  • 1970-01-01
相关资源
最近更新 更多