0
votes

I have a social networking project developed by a team of developers. I am attempting to run it on my localhost via Xampp and have got the site up to a basic html version displaying some static pages. At this point, I am receiving many internal server errors and I would like to query if the reasons behind this is my server not configured correctly. I do not have experience with servers and have spent quite some time clicking through the document below. Having noticed many "access denied" errors, I am assuming it is server configuration. I have also been searching through my apache file to figure it out but no success.

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

2
"client denied by server configuration" looks like there is something not properly configured on the 'server'.Jelle Posthuma
Having spent time reading through it all i believed it to be but,,, pin pointing the why is being quite the trouble.James
"Unknown database 'symfony'' . check parameters.yml and change the DB credentials.Shahroze Nawaz

2 Answers

1
votes

based on this line: PDOConnection->__construct('mysql:host=127....', 'root', NULL, Array)\n

and the message: Unknown database 'symfony'

It appears you haven't correctly set the app/config/parameters.yml file for your database.

You'll need to figure out your MySQL root user and pass, then from the command line create a user with access to the database you will use for your Symfony project. Then run these commands:

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

Then edit your app/config/parameters.yml file like so:

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

Then from the Symfony project's root folder you can run:

php bin/console doctrine:database:create

That should setup everything for you. You can read about all this at the Symfony docs here:

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

0
votes

The first fatal error looks to be PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'symfony''.

Double check your database connections in Symfony and ensure that you have the database accessible in your local environment.