安装和配置symfony 3.2

时间:2017-01-07 20:08:03

标签: php apache symfony apache-config

尝试安装Symfony 3.2 ,我试图按照这里的说明进行操作:

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

首先运行命令时:

php.exe symfony新的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>

我还将Document root更改为“C:\ xampp \ htdocs \ SymfonyProject \ web”,并尝试了“C:\ xampp \ htdocs \ SymfonyProject”(以防万一)无济于事。

但仍然收到错误

Error from apache running Symfony project

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也是一个有效的页面,但我仍然会收到错误。

您的帮助将受到高度赞赏

2 个答案:

答案 0 :(得分:0)

抱歉,我错过了一步。

运行,php bin / console服务器:按此处所述运行:

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

允许我访问config.php文件。

答案 1 :(得分:-1)

尝试此更改:

...
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/