我最近安装了一个本地网络服务器(XAMPP),因此我可以使用Laravel PHP框架。我成功安装了xampp并更改了Apache httpd.conf
以侦听端口8080.
我还设法让Laravel启动并运行:
但是我注意到我无法连接到数据库,页面将永远加载而不会向我显示任何错误。当我运行这个简单的代码时,同样的事情:
<?php
error_reporting(E_ALL);
$host = 'localhost:8080';
$name = 'test';
$user = 'root';
$pass = '';
mysqli_connect($host, $user, $pass, $name) or die ("Oops");
当我启动Apache时会发生这种情况:
在Apache错误日志中,我发现了这个:
[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.
我认为这是我无法连接到数据库的原因。但我似乎无法弄明白。在问这个问题之前我经常搜索过很多。我希望有人可以帮助我。