I recently installed a local webserver (XAMPP) so I could work with the Laravel PHP framework. I successfully installed xampp and changed the Apache httpd.conf
to listen to port 8080.
I also managed to get Laravel up and running:
But I noticed I couldn't connect to the database, the page would just load forever without showing me any errors. Same thing when I ran this simple code:
<?php
error_reporting(E_ALL);
$host = 'localhost:8080';
$name = 'test';
$user = 'root';
$pass = '';
mysqli_connect($host, $user, $pass, $name) or die ("Oops");
This happens when I start Apache:
In the Apache error log I found this:
[Mon Sep 22 14:47:29.969486 2014] [ssl:warn] [pid 5044:tid 388] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 22 14:47:29.996504 2014] [core:warn] [pid 5044:tid 388] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Mon Sep 22 14:47:30.087565 2014] [ssl:warn] [pid 5044:tid 388] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 22 14:47:30.117584 2014] [mpm_winnt:notice] [pid 5044:tid 388] AH00455: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 configured -- resuming normal operations
[Mon Sep 22 14:47:30.117584 2014] [mpm_winnt:notice] [pid 5044:tid 388] AH00456: Apache Lounge VC11 Server built: Jul 17 2014 11:50:08
[Mon Sep 22 14:47:30.117584 2014] [core:notice] [pid 5044:tid 388] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Mon Sep 22 14:47:30.119586 2014] [mpm_winnt:notice] [pid 5044:tid 388] AH00418: Parent: Created child process 2608
[Mon Sep 22 14:47:30.488831 2014] [ssl:warn] [pid 2608:tid 412] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 22 14:47:30.605909 2014] [ssl:warn] [pid 2608:tid 412] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Mon Sep 22 14:47:30.637930 2014] [mpm_winnt:notice] [pid 2608:tid 412] AH00354: Child: Starting 150 worker threads.
I think this is the reason that I can't connect to the database. But I can't seem to figure it out. I've searched a lot before asking this question. I hope somebody could help me out.