gpt4 book ai didi

php - Xampp 上的 Symfony 项目返回 500 个内部服务器错误

转载 作者:行者123 更新时间:2023-11-29 10:41:28 26 4
gpt4 key购买 nike

我有一个由开发团队开发的社交网络项目。我正在尝试通过 Xampp 在我的本地主机上运行它,并将该站点升级为显示一些静态页面的基本 html 版本。此时,我收到许多内部服务器错误,我想询问这背后的原因是否是我的服务器配置不正确。我没有使用服务器的经验,并且花了相当长的时间点击下面的文档。注意到许多“访问被拒绝”错误后,我假设这是服务器配置。我也一直在搜索我的 apache 文件来找出答案,但没有成功。

[Sat Jul 29 19:36:54.460754 2017] [ssl:warn] [pid 10816:tid 492] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Sat Jul 29 19:36:54.591630 2017] [core:warn] [pid 10816:tid 492] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run? [Sat Jul 29 19:36:54.709621 2017] [ssl:warn] [pid 10816:tid 492] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Sat Jul 29 19:36:55.727316 2017] [mpm_winnt:notice] [pid 10816:tid 492] AH00455: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28 configured -- resuming normal operations [Sat Jul 29 19:36:55.727316 2017] [mpm_winnt:notice] [pid 10816:tid 492] AH00456: Apache Lounge VC11 Server built: Jul 7 2016 11:13:22 [Sat Jul 29 19:36:55.727316 2017] [core:notice] [pid 10816:tid 492] AH00094: Command line: 'c:\xampp\apache\bin\httpd.exe -d C:/xampp/apache' [Sat Jul 29 19:36:55.730318 2017] [mpm_winnt:notice] [pid 10816:tid 492] AH00418: Parent: Created child process 6844 [Sat Jul 29 19:36:57.050472 2017] [ssl:warn] [pid 6844:tid 540] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Sat Jul 29 19:36:57.255467 2017] [ssl:warn] [pid 6844:tid 540] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name [Sat Jul 29 19:36:57.296495 2017] [mpm_winnt:notice] [pid 6844:tid 540] AH00354: Child: Starting 150 worker threads. [Sat Jul 29 19:37:40.131691 2017] [authz_core:error] [pid 6844:tid 1844] [client ::1:57744] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/app/, referer: //http://localhost/vabble/ [Sat Jul 29 19:37:40.241477 2017] [authz_core:error] [pid 6844:tid 1844] [client ::1:57744] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/src/, referer: http://localhost/vabble/ [Sat Jul 29 19:37:57.587627 2017] [:error] [pid 6844:tid 1828] [client ::1:57752] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'symfony'' in C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:43\nStack trace:\n#0 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php(43): PDO->__construct('mysql:host=127....', 'root', NULL, Array)\n#1 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOMySql\Driver.php(45): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=127....', 'root', NULL, Array)\n#2 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'root', NULL, Array)\n#3 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(429): Doctrine\DBAL\Connection->connect()\n#4 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(389): Doctrine\DBAL\Connection->getDatabas in C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php on line 103, referer: http://localhost/vabble/Vabble-code/ [Sat Jul 29 19:43:56.135682 2017] [:error] [pid 6844:tid 1852] [client ::1:57884] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'symfony'' in C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:43\nStack trace:\n#0 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php(43): PDO->__construct('mysql:host=127....', 'root', NULL, Array)\n#1 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOMySql\Driver.php(45): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=127....', 'root', NULL, Array)\n#2 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, 'root', NULL, Array)\n#3 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(429): Doctrine\DBAL\Connection->connect()\n#4 C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(389): Doctrine\DBAL\Connection->getDatabas in C:\xampp\htdocs\Vabble\Vabble-code\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php on line 103, referer: http://localhost/vabble/Vabble-code/ [Sat Jul 29 20:03:08.221738 2017] [authz_core:error] [pid 6844:tid 1852] [client ::1:58357] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/app/, referer: http://localhost/vabble/ [Sat Jul 29 20:03:08.271769 2017] [authz_core:error] [pid 6844:tid 1852] [client ::1:58357] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/src/, referer: http://localhost/vabble/ [Sat Jul 29 20:06:49.828650 2017] [authz_core:error] [pid 6844:tid 1828] [client ::1:58396] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/app/, referer: http://localhost/vabble/ [Sat Jul 29 20:18:45.773285 2017] [authz_core:error] [pid 6844:tid 1868] [client ::1:58525] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/app/, referer: http://localhost/vabble/ [Sat Jul 29 20:18:45.833328 2017] [authz_core:error] [pid 6844:tid 1868] [client ::1:58525] AH01630: client denied by server configuration: C:/xampp/htdocs/Vabble/Vabble-code/src/, referer: http://localhost/vabble/

最佳答案

基于这一行:PDOConnection->__construct('mysql:host=127....', 'root', NULL, Array)\n

和消息:未知数据库“symfony”

您似乎没有正确设置数据库的 app/config/parameters.yml 文件。

您需要找出您的 MySQL root 用户并通过,然后从命令行创建一个可以访问您将用于 Symfony 项目的数据库的用户。然后运行这些命令:

mysql -u root -p
******
CREATE DATABASE vabble;
use mysql;
GRANT ALL PRIVILEGES ON vabble.* TO 'james'@'192.168.0.2' IDENTIFIED BY 'mypass';

然后编辑您的 app/config/parameters.yml 文件,如下所示:

parameters:
database_host: localhost
database_name: vabble
database_user: james
database_password: mypass

然后从 Symfony 项目的根文件夹中您可以运行:

php bin/console doctrine:database:create

这应该为你设置好一切。您可以在 Symfony 文档中阅读所有这些内容:

https://symfony.com/doc/current/doctrine.html#a-simple-example-a-product

关于php - Xampp 上的 Symfony 项目返回 500 个内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45393331/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com